diff --git a/AirSync.entitlements b/AirSync.entitlements new file mode 100644 index 00000000..864feab7 --- /dev/null +++ b/AirSync.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.sameerasw.airsync-mac.widget + + + diff --git a/AirSync.xcodeproj/project.pbxproj b/AirSync.xcodeproj/project.pbxproj index 0056002d..45efda1f 100644 --- a/AirSync.xcodeproj/project.pbxproj +++ b/AirSync.xcodeproj/project.pbxproj @@ -15,15 +15,47 @@ B98CBE7B2FE6935F00C950DA /* Installations in Frameworks */ = {isa = PBXBuildFile; productRef = B98CBE7A2FE6935F00C950DA /* Installations */; }; B98CBE802FE69D9000C950DA /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = B98CBE7F2FE69D9000C950DA /* Sparkle */; }; B99B04C62F641E1400FF3E2D /* AppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = B99B04C52F641E1400FF3E2D /* AppIcon.icon */; }; + B99D63FA3059A794003D951A /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B99D63F93059A794003D951A /* WidgetKit.framework */; }; + B99D63FC3059A794003D951A /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B99D63FB3059A794003D951A /* SwiftUI.framework */; }; + B99D64093059A795003D951A /* AirSyncWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = B99D63F83059A794003D951A /* AirSyncWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; B9B1C00D2E94E15D0005F6CB /* LottieUI in Frameworks */ = {isa = PBXBuildFile; productRef = B9B1C00C2E94E15D0005F6CB /* LottieUI */; }; B9C3181E2E37AA1D00367F16 /* QRCode in Frameworks */ = {isa = PBXBuildFile; productRef = B9C3181D2E37AA1D00367F16 /* QRCode */; }; B9D742FC2E39CF850053128A /* Swifter in Frameworks */ = {isa = PBXBuildFile; productRef = B9D742FB2E39CF850053128A /* Swifter */; }; B9E423832FBD914900526D40 /* scrcpy-server in Resources */ = {isa = PBXBuildFile; fileRef = B9E423822FBD914900526D40 /* scrcpy-server */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + B99D64073059A795003D951A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B9673B4F2E35A2A1006D284A /* Project object */; + proxyType = 1; + remoteGlobalIDString = B99D63F73059A794003D951A; + remoteInfo = AirSyncWidgetExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + B99D640A3059A795003D951A /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + B99D64093059A795003D951A /* AirSyncWidgetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ B9673B572E35A2A1006D284A /* AirSync.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AirSync.app; sourceTree = BUILT_PRODUCTS_DIR; }; B99B04C52F641E1400FF3E2D /* AppIcon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = AppIcon.icon; sourceTree = ""; }; + B99D63F83059A794003D951A /* AirSyncWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = AirSyncWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + B99D63F93059A794003D951A /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + B99D63FB3059A794003D951A /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + B99D64143059A9B3003D951A /* AirSync.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AirSync.entitlements; sourceTree = ""; }; + B99D64153059A9FC003D951A /* AirSyncWidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AirSyncWidgetExtension.entitlements; sourceTree = ""; }; B9E423822FBD914900526D40 /* scrcpy-server */ = {isa = PBXFileReference; lastKnownFileType = file; path = "scrcpy-server"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -35,10 +67,25 @@ Configs/Secrets.xcconfig, Configs/SelfCompiled.xcconfig, Configs/Shared.xcconfig, + Core/QuickShare/GenerateProtobuf.sh, + Core/QuickShare/ProtobufSource/device_to_device_messages.proto, + Core/QuickShare/ProtobufSource/offline_wire_formats.proto, + Core/QuickShare/ProtobufSource/securegcm.proto, + Core/QuickShare/ProtobufSource/securemessage.proto, + Core/QuickShare/ProtobufSource/sharing_enums.proto, + Core/QuickShare/ProtobufSource/ukey.proto, + Core/QuickShare/ProtobufSource/wire_format.proto, Info.plist, ); target = B9673B562E35A2A1006D284A /* AirSync */; }; + B99D640F3059A795003D951A /* Exceptions for "AirSyncWidget" folder in "AirSyncWidgetExtension" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = B99D63F73059A794003D951A /* AirSyncWidgetExtension */; + }; /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ @@ -50,6 +97,14 @@ path = "airsync-mac"; sourceTree = ""; }; + B99D63FD3059A794003D951A /* AirSyncWidget */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + B99D640F3059A795003D951A /* Exceptions for "AirSyncWidget" folder in "AirSyncWidgetExtension" target */, + ); + path = AirSyncWidget; + sourceTree = ""; + }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -70,13 +125,25 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B99D63F53059A794003D951A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B99D63FC3059A794003D951A /* SwiftUI.framework in Frameworks */, + B99D63FA3059A794003D951A /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ B9673B4E2E35A2A1006D284A = { isa = PBXGroup; children = ( + B99D64153059A9FC003D951A /* AirSyncWidgetExtension.entitlements */, + B99D64143059A9B3003D951A /* AirSync.entitlements */, B9673B592E35A2A1006D284A /* airsync-mac */, + B99D63FD3059A794003D951A /* AirSyncWidget */, B9D263192F60D97900628704 /* Frameworks */, B9673B582E35A2A1006D284A /* Products */, B99B04C52F641E1400FF3E2D /* AppIcon.icon */, @@ -88,6 +155,7 @@ isa = PBXGroup; children = ( B9673B572E35A2A1006D284A /* AirSync.app */, + B99D63F83059A794003D951A /* AirSyncWidgetExtension.appex */, ); name = Products; sourceTree = ""; @@ -95,6 +163,8 @@ B9D263192F60D97900628704 /* Frameworks */ = { isa = PBXGroup; children = ( + B99D63F93059A794003D951A /* WidgetKit.framework */, + B99D63FB3059A794003D951A /* SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -109,10 +179,12 @@ B9673B532E35A2A1006D284A /* Sources */, B9673B542E35A2A1006D284A /* Frameworks */, B9673B552E35A2A1006D284A /* Resources */, + B99D640A3059A795003D951A /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + B99D64083059A795003D951A /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( B9673B592E35A2A1006D284A /* airsync-mac */, @@ -134,6 +206,28 @@ productReference = B9673B572E35A2A1006D284A /* AirSync.app */; productType = "com.apple.product-type.application"; }; + B99D63F73059A794003D951A /* AirSyncWidgetExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = B99D640E3059A795003D951A /* Build configuration list for PBXNativeTarget "AirSyncWidgetExtension" */; + buildPhases = ( + B99D63F43059A794003D951A /* Sources */, + B99D63F53059A794003D951A /* Frameworks */, + B99D63F63059A794003D951A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + B99D63FD3059A794003D951A /* AirSyncWidget */, + ); + name = AirSyncWidgetExtension; + packageProductDependencies = ( + ); + productName = AirSyncWidgetExtension; + productReference = B99D63F83059A794003D951A /* AirSyncWidgetExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -141,12 +235,15 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 2600; + LastSwiftUpdateCheck = 2700; LastUpgradeCheck = 2620; TargetAttributes = { B9673B562E35A2A1006D284A = { CreatedOnToolsVersion = 26.0; }; + B99D63F73059A794003D951A = { + CreatedOnToolsVersion = 27.0; + }; }; }; buildConfigurationList = B9673B522E35A2A1006D284A /* Build configuration list for PBXProject "AirSync" */; @@ -175,6 +272,7 @@ projectRoot = ""; targets = ( B9673B562E35A2A1006D284A /* AirSync */, + B99D63F73059A794003D951A /* AirSyncWidgetExtension */, ); }; /* End PBXProject section */ @@ -189,6 +287,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B99D63F63059A794003D951A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -199,8 +304,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B99D63F43059A794003D951A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + B99D64083059A795003D951A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B99D63F73059A794003D951A /* AirSyncWidgetExtension */; + targetProxy = B99D64073059A795003D951A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 11F6093B2EA2A88900AB6BDC /* Self Compiled */ = { isa = XCBuildConfiguration; @@ -273,7 +393,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; AUTOMATION_APPLE_EVENTS = NO; - CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_ENTITLEMENTS = AirSync.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 31; @@ -453,7 +573,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; AUTOMATION_APPLE_EVENTS = NO; - CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_ENTITLEMENTS = AirSync.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 31; @@ -505,7 +625,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; AUTOMATION_APPLE_EVENTS = NO; - CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_ENTITLEMENTS = AirSync.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 31; @@ -548,6 +668,108 @@ }; name = Release; }; + B99D640B3059A795003D951A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = AirSyncWidgetExtension.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 31; + DEVELOPMENT_TEAM = WCB4HTANA6; + ENABLE_APP_SANDBOX = YES; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AirSyncWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AirSyncWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 27.0; + MARKETING_VERSION = 4.0.1; + PRODUCT_BUNDLE_IDENTIFIER = "sameerasw.airsync-mac.widget"; + PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + B99D640C3059A795003D951A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = AirSyncWidgetExtension.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 31; + DEVELOPMENT_TEAM = WCB4HTANA6; + ENABLE_APP_SANDBOX = YES; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AirSyncWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AirSyncWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 27.0; + MARKETING_VERSION = 4.0.1; + PRODUCT_BUNDLE_IDENTIFIER = "sameerasw.airsync-mac.widget"; + PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + B99D640D3059A795003D951A /* Self Compiled */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = AirSyncWidgetExtension.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 31; + DEVELOPMENT_TEAM = WCB4HTANA6; + ENABLE_APP_SANDBOX = YES; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AirSyncWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AirSyncWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 27.0; + MARKETING_VERSION = 4.0.1; + PRODUCT_BUNDLE_IDENTIFIER = "sameerasw.airsync-mac.widget"; + PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + }; + name = "Self Compiled"; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -571,6 +793,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + B99D640E3059A795003D951A /* Build configuration list for PBXNativeTarget "AirSyncWidgetExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B99D640B3059A795003D951A /* Debug */, + B99D640C3059A795003D951A /* Release */, + B99D640D3059A795003D951A /* Self Compiled */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ diff --git a/AirSync.xcodeproj/xcshareddata/xcschemes/AirSyncWidgetExtension.xcscheme b/AirSync.xcodeproj/xcshareddata/xcschemes/AirSyncWidgetExtension.xcscheme new file mode 100644 index 00000000..267a88a4 --- /dev/null +++ b/AirSync.xcodeproj/xcshareddata/xcschemes/AirSyncWidgetExtension.xcscheme @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AirSyncWidget/AirSyncWidget.swift b/AirSyncWidget/AirSyncWidget.swift new file mode 100644 index 00000000..cd046dc9 --- /dev/null +++ b/AirSyncWidget/AirSyncWidget.swift @@ -0,0 +1,16 @@ +// +// AirSyncWidget.swift +// AirSyncWidget +// +// Created by Sameera Sandakelum on 2026-09-15. +// + +import WidgetKit +import SwiftUI + +@main +struct AirSyncWidgetBundle: WidgetBundle { + var body: some Widget { + PhoneInfoWidget() + } +} diff --git a/AirSyncWidget/Assets.xcassets/AccentColor.colorset/Contents.json b/AirSyncWidget/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/AirSyncWidget/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirSyncWidget/Assets.xcassets/AppIcon.appiconset/Contents.json b/AirSyncWidget/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..3f00db43 --- /dev/null +++ b/AirSyncWidget/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirSyncWidget/Assets.xcassets/Contents.json b/AirSyncWidget/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/AirSyncWidget/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirSyncWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/AirSyncWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/AirSyncWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AirSyncWidget/BatteryIconView.swift b/AirSyncWidget/BatteryIconView.swift new file mode 100644 index 00000000..6781b42f --- /dev/null +++ b/AirSyncWidget/BatteryIconView.swift @@ -0,0 +1,51 @@ +// +// BatteryIconView.swift +// AirSyncWidget +// + +import SwiftUI + +struct BatteryIconView: View { + let level: Int + let isCharging: Bool + + var body: some View { + HStack(spacing: 4) { + ZStack { + RoundedRectangle(cornerRadius: 2) + .stroke(Color.primary.opacity(0.3), lineWidth: 1) + .frame(width: 16, height: 10) + + HStack(spacing: 0) { + RoundedRectangle(cornerRadius: 1) + .fill(Color.primary.opacity(0.7)) + .frame(width: max(1, CGFloat(level) / 100 * 12)) + + Spacer() + } + .padding(1) + .frame(width: 14, height: 8) + } + + Text("\(level)%") + .font(.system(.caption2, design: .rounded)) + .foregroundColor(.primary) + + if isCharging { + Image(systemName: "bolt.fill") + .font(.system(size: 8)) + .foregroundColor(.primary.opacity(0.7)) + } + } + } +} + +#Preview { + VStack(spacing: 10) { + BatteryIconView(level: 90, isCharging: false) + BatteryIconView(level: 50, isCharging: false) + BatteryIconView(level: 15, isCharging: false) + BatteryIconView(level: 45, isCharging: true) + } + .padding() +} diff --git a/AirSyncWidget/Info.plist b/AirSyncWidget/Info.plist new file mode 100644 index 00000000..0f118fb7 --- /dev/null +++ b/AirSyncWidget/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/AirSyncWidget/PhoneDeviceView.swift b/AirSyncWidget/PhoneDeviceView.swift new file mode 100644 index 00000000..5442954c --- /dev/null +++ b/AirSyncWidget/PhoneDeviceView.swift @@ -0,0 +1,49 @@ +// +// PhoneDeviceView.swift +// AirSyncWidget +// + +import SwiftUI +import AppKit +import WidgetKit + +struct PhoneDeviceView: View { + let wallpaperImageData: Data? + + @Environment(\.widgetRenderingMode) private var renderingMode + + var body: some View { + ZStack { + RoundedRectangle(cornerRadius: 10) + .fill(Color.gray.opacity(0.3)) + + if let imageData = wallpaperImageData, + let nsImage = NSImage(data: imageData) { + renderedWallpaper(nsImage) + } + } + .aspectRatio(CGSize(width: 60, height: 120), contentMode: .fit) + .clipShape(RoundedRectangle(cornerRadius: 10)) + } + + @ViewBuilder + private func renderedWallpaper(_ nsImage: NSImage) -> some View { + if #available(macOS 15.0, *), renderingMode == .accented { + Image(nsImage: nsImage) + .resizable() + .widgetAccentedRenderingMode(.accentedDesaturated) + .scaledToFill() + .clipped() + } else { + Image(nsImage: nsImage) + .resizable() + .scaledToFill() + .clipped() + } + } +} + +#Preview { + PhoneDeviceView(wallpaperImageData: nil) + .frame(height: 100) +} diff --git a/AirSyncWidget/PhoneInfoWidget.swift b/AirSyncWidget/PhoneInfoWidget.swift new file mode 100644 index 00000000..7aae3e64 --- /dev/null +++ b/AirSyncWidget/PhoneInfoWidget.swift @@ -0,0 +1,599 @@ +// +// PhoneInfoWidget.swift +// AirSyncWidget +// +// Created by Sameera Sandakelum on 2026-09-15. +// + +import WidgetKit +import SwiftUI +import AppKit + +struct PhoneInfoEntry: TimelineEntry { + let date: Date + let deviceName: String + let batteryLevel: Int + let isCharging: Bool + let isPaired: Bool + let wallpaperImageData: Data? + let isLocalNetwork: Bool + let isBLEConnected: Bool + let isADBConnected: Bool + let adbMode: String + let isMusicPlaying: Bool + let musicTitle: String + let musicArtist: String + let musicAlbumArtData: Data? +} + +struct PhoneInfoWidgetEntryView: View { + var entry: PhoneInfoEntry + @Environment(\.widgetFamily) var widgetFamily + @Environment(\.widgetRenderingMode) private var renderingMode + @Environment(\.widgetContentMargins) private var contentMargins + + var body: some View { + if entry.isPaired { + switch widgetFamily { + case .systemLarge: + largeLayout + case .systemMedium: + mediumLayout + default: + smallLayout + } + } else { + disconnectedLayout + } + } + + @ViewBuilder + private var glassBackground: some View { + if #available(macOS 26.0, *) { + Color.clear.glassEffect(in: .rect(cornerRadius: 0)) + } else { + Color.clear.background(.ultraThinMaterial) + } + } + + private var smallLayout: some View { + VStack(spacing: 8) { + PhoneDeviceView(wallpaperImageData: entry.wallpaperImageData) + .frame(maxHeight: 100) + + VStack(spacing: 2) { + Text(entry.deviceName) + .font(.system(.caption, design: .rounded)) + .lineLimit(1) + .foregroundColor(.primary) + + BatteryIconView(level: entry.batteryLevel, isCharging: entry.isCharging) + } + .widgetAccentable() + } + .padding(12) + .padding(contentMargins) + .containerBackground(for: .widget) { glassBackground } + } + + private var mediumLayout: some View { + HStack(spacing: 0) { + PhoneDeviceView(wallpaperImageData: entry.wallpaperImageData) + .frame(maxHeight: 110) + .padding(.trailing, 20) + + Spacer() + + VStack(alignment: .trailing, spacing: 8) { + Text(entry.deviceName) + .font(.system(.headline, design: .rounded)) + .lineLimit(2) + .foregroundColor(.primary) + .multilineTextAlignment(.trailing) + .widgetAccentable() + + if entry.isMusicPlaying { + statusIconsRow + Spacer() + mediaPlayerRow + } else { + Spacer() + statusIconsRow + } + } + } + .padding(16) + .padding(contentMargins) + .containerBackground(for: .widget) { glassBackground } + } + + private var largeLayout: some View { + ZStack { + if let nsImage = largeBackgroundNSImage { + GeometryReader { geo in + ZStack { + largeBackgroundImage(nsImage) + .frame(width: geo.size.width, height: geo.size.height) + .clipped() + + blurredBackgroundLayer(nsImage, size: geo.size, radius: 6, fadeStart: 0.35) + blurredBackgroundLayer(nsImage, size: geo.size, radius: 16, fadeStart: 0.55) + blurredBackgroundLayer(nsImage, size: geo.size, radius: 32, fadeStart: 0.75) + } + } + + LinearGradient( + colors: [.clear, .black.opacity(0.55)], + startPoint: .center, + endPoint: .bottom + ) + .ignoresSafeArea() + } + + VStack(spacing: 0) { + largeStatusIconsRow + + Spacer() + + if entry.isMusicPlaying { + VStack(spacing: 4) { + Text(entry.musicTitle) + .font(.title3) + .fontWeight(.semibold) + .lineLimit(1) + .foregroundColor(.white) + Text(entry.musicArtist) + .font(.subheadline) + .lineLimit(1) + .foregroundColor(.white.opacity(0.8)) + } + .multilineTextAlignment(.center) + + Spacer() + } + + Text(entry.deviceName) + .font(.title2) + .fontWeight(.semibold) + .lineLimit(1) + .foregroundColor(.white) + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + .padding(contentMargins) + } + .containerBackground(for: .widget) { glassBackground } + } + + private var largeStatusIconsRow: some View { + HStack(spacing: 6) { + if entry.isLocalNetwork { + Image(systemName: "wifi") + .font(.system(size: 10)) + } + if entry.isADBConnected { + Image(systemName: entry.adbMode == "wired" ? "cable.connector" : "iphone.gen3.crop.circle") + .font(.system(size: 10)) + } + if entry.isBLEConnected { + Image(systemName: "bluetooth") + .font(.system(size: 10)) + } + BatteryIconView(level: entry.batteryLevel, isCharging: entry.isCharging) + } + .foregroundColor(.white) + .padding(.horizontal, 10) + .padding(.vertical, 5) + .background( + .black.opacity(0.3) +// .ultraThinMaterial + , in: Capsule()) +// .widgetAccentable() + } + + private var largeBackgroundNSImage: NSImage? { + if entry.isMusicPlaying, let artData = entry.musicAlbumArtData, let nsImage = NSImage(data: artData) { + return nsImage + } + if let wallpaperData = entry.wallpaperImageData, let nsImage = NSImage(data: wallpaperData) { + return nsImage + } + return nil + } + + private func blurredBackgroundLayer( + _ nsImage: NSImage, + size: CGSize, + radius: CGFloat, + fadeStart: CGFloat + ) -> some View { + largeBackgroundImage(nsImage) + .frame(width: size.width, height: size.height) + .blur(radius: radius) + .scaleEffect(1.1) + .clipped() + .mask( + LinearGradient( + stops: [ + .init(color: .clear, location: fadeStart), + .init(color: .white, location: min(fadeStart + 0.25, 1.0)) + ], + startPoint: .top, + endPoint: .bottom + ) + ) + } + + @ViewBuilder + private func largeBackgroundImage(_ nsImage: NSImage) -> some View { + if #available(macOS 15.0, *), renderingMode == .accented { + Image(nsImage: nsImage) + .resizable() + .widgetAccentedRenderingMode(.accentedDesaturated) + .scaledToFill() + } else { + Image(nsImage: nsImage) + .resizable() + .scaledToFill() + } + } + + private var statusIconsRow: some View { + HStack(spacing: 6) { + if entry.isLocalNetwork { + Image(systemName: "wifi") + .font(.system(size: 10)) + } + if entry.isADBConnected { + Image(systemName: entry.adbMode == "wired" ? "cable.connector" : "iphone.gen3.crop.circle") + .font(.system(size: 10)) + } + if entry.isBLEConnected { + Image(systemName: "bluetooth") + .font(.system(size: 10)) + } + BatteryIconView(level: entry.batteryLevel, isCharging: entry.isCharging) + } + .foregroundColor(.secondary) + .widgetAccentable() + } + + private var mediaPlayerRow: some View { + HStack(spacing: 10) { + VStack(alignment: .trailing, spacing: 2) { + Text(entry.musicTitle) + .font(.system(.caption, design: .rounded)) + .lineLimit(1) + .foregroundColor(.primary) + Text(entry.musicArtist) + .font(.system(.caption2, design: .rounded)) + .lineLimit(1) + .foregroundColor(.secondary) + } + .widgetAccentable() + + if let artData = entry.musicAlbumArtData, let nsImage = NSImage(data: artData) { + renderedAlbumArt(nsImage) + } else { + RoundedRectangle(cornerRadius: 8) + .fill(Color.gray.opacity(0.3)) + .frame(width: 48, height: 48) + .overlay( + Image(systemName: "music.note") + .font(.system(size: 16)) + .foregroundColor(.secondary) + ) + .widgetAccentable() + } + } + } + + @ViewBuilder + private func renderedAlbumArt(_ nsImage: NSImage) -> some View { + if #available(macOS 15.0, *), renderingMode == .accented { + Image(nsImage: nsImage) + .resizable() + .widgetAccentedRenderingMode(.accentedDesaturated) + .scaledToFill() + .frame(width: 48, height: 48) + .clipShape(RoundedRectangle(cornerRadius: 8)) + } else { + Image(nsImage: nsImage) + .resizable() + .scaledToFill() + .frame(width: 48, height: 48) + .clipShape(RoundedRectangle(cornerRadius: 8)) + } + } + + private var disconnectedLayout: some View { + VStack(spacing: 12) { + ZStack(alignment: .bottomTrailing) { + PhoneDeviceView(wallpaperImageData: entry.wallpaperImageData) + .frame(maxHeight: 100) + .grayscale(1) + .opacity(0.6) + + Image(systemName: "iphone.slash") + .font(.system(size: 20)) + .foregroundColor(.gray) + .padding(4) + .background(Color(nsColor: .controlBackgroundColor)) + .cornerRadius(8) + .offset(x: 8, y: 8) + .widgetAccentable() + } + + Text(entry.deviceName) + .font(.system(.caption, design: .rounded)) + .lineLimit(1) + .foregroundColor(.primary) + .widgetAccentable() + } + .padding(12) + .padding(contentMargins) + .containerBackground(for: .widget) { glassBackground } + } +} + +struct PhoneInfoWidget: Widget { + let kind: String = "PhoneInfoWidget" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: PhoneInfoProvider()) { entry in + PhoneInfoWidgetEntryView(entry: entry) + } + .configurationDisplayName("Phone Info") + .description("Display your connected phone's battery and status") + .supportedFamilies([.systemSmall, .systemMedium, .systemLarge]) + .contentMarginsDisabled() + } +} + +struct PhoneInfoProvider: TimelineProvider { + private var sharedDefaults: UserDefaults? { + UserDefaults(suiteName: APP_GROUP_IDENTIFIER) + } + + private func getSharedData() -> PhoneInfoEntry { + let shared = sharedDefaults + let deviceName = shared?.string(forKey: WIDGET_DATA_KEYS.deviceName) ?? "Unknown" + let batteryLevel = shared?.integer(forKey: WIDGET_DATA_KEYS.batteryLevel) ?? 0 + let isCharging = shared?.bool(forKey: WIDGET_DATA_KEYS.isCharging) ?? false + let isPaired = shared?.bool(forKey: WIDGET_DATA_KEYS.isPaired) ?? false + + var wallpaperData: Data? = nil + if let base64String = shared?.string(forKey: WIDGET_DATA_KEYS.wallpaperBase64) { + wallpaperData = Data(base64Encoded: base64String) + } + + let isLocalNetwork = shared?.bool(forKey: WIDGET_DATA_KEYS.isLocalNetwork) ?? false + let isBLEConnected = shared?.bool(forKey: WIDGET_DATA_KEYS.isBLEConnected) ?? false + let isADBConnected = shared?.bool(forKey: WIDGET_DATA_KEYS.isADBConnected) ?? false + let adbMode = shared?.string(forKey: WIDGET_DATA_KEYS.adbMode) ?? "wireless" + + let isMusicPlaying = shared?.bool(forKey: WIDGET_DATA_KEYS.isMusicPlaying) ?? false + let musicTitle = shared?.string(forKey: WIDGET_DATA_KEYS.musicTitle) ?? "" + let musicArtist = shared?.string(forKey: WIDGET_DATA_KEYS.musicArtist) ?? "" + var musicAlbumArtData: Data? = nil + if let albumArtBase64 = shared?.string(forKey: WIDGET_DATA_KEYS.musicAlbumArt), !albumArtBase64.isEmpty { + musicAlbumArtData = Data(base64Encoded: albumArtBase64) + } + + return PhoneInfoEntry( + date: Date(), + deviceName: deviceName, + batteryLevel: batteryLevel, + isCharging: isCharging, + isPaired: isPaired, + wallpaperImageData: wallpaperData, + isLocalNetwork: isLocalNetwork, + isBLEConnected: isBLEConnected, + isADBConnected: isADBConnected, + adbMode: adbMode, + isMusicPlaying: isMusicPlaying, + musicTitle: musicTitle, + musicArtist: musicArtist, + musicAlbumArtData: musicAlbumArtData + ) + } + + func placeholder(in context: Context) -> PhoneInfoEntry { + PhoneInfoEntry( + date: Date(), + deviceName: "Loading...", + batteryLevel: 0, + isCharging: false, + isPaired: false, + wallpaperImageData: nil, + isLocalNetwork: false, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) + } + + func getSnapshot(in context: Context, completion: @escaping (PhoneInfoEntry) -> ()) { + completion(getSharedData()) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { + let currentDate = Date() + let refreshDate = Calendar.current.date(byAdding: .second, value: 30, to: currentDate)! + + let entry = getSharedData() + let timeline = Timeline(entries: [entry], policy: .after(refreshDate)) + completion(timeline) + } +} + +#Preview("Small - Connected", as: .systemSmall) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Pixel 8", + batteryLevel: 75, + isCharging: false, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: false, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) +} + +#Preview("Small - Low Battery", as: .systemSmall) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Galaxy S24", + batteryLevel: 15, + isCharging: false, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: false, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) +} + +#Preview("Small - Charging", as: .systemSmall) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "iPhone 15", + batteryLevel: 45, + isCharging: true, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: false, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) +} + +#Preview("Medium - Connected", as: .systemMedium) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Pixel 8 Pro", + batteryLevel: 82, + isCharging: true, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: true, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) +} + +#Preview("Medium - Playing Music", as: .systemMedium) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Pixel 8 Pro", + batteryLevel: 82, + isCharging: false, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: true, + isBLEConnected: false, + isADBConnected: true, + adbMode: "wireless", + isMusicPlaying: true, + musicTitle: "Blinding Lights", + musicArtist: "The Weeknd", + musicAlbumArtData: nil + ) +} + +#Preview("Large - Connected", as: .systemLarge) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Pixel 8 Pro", + batteryLevel: 82, + isCharging: true, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: true, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) +} + +#Preview("Large - Playing Music", as: .systemLarge) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Pixel 8 Pro", + batteryLevel: 82, + isCharging: false, + isPaired: true, + wallpaperImageData: nil, + isLocalNetwork: true, + isBLEConnected: false, + isADBConnected: true, + adbMode: "wireless", + isMusicPlaying: true, + musicTitle: "Blinding Lights", + musicArtist: "The Weeknd", + musicAlbumArtData: nil + ) +} + +#Preview("Disconnected", as: .systemSmall) { + PhoneInfoWidget() +} timeline: { + PhoneInfoEntry( + date: .now, + deviceName: "Unknown", + batteryLevel: 0, + isCharging: false, + isPaired: false, + wallpaperImageData: nil, + isLocalNetwork: false, + isBLEConnected: false, + isADBConnected: false, + adbMode: "wireless", + isMusicPlaying: false, + musicTitle: "", + musicArtist: "", + musicAlbumArtData: nil + ) +} diff --git a/AirSyncWidget/SharedConstants.swift b/AirSyncWidget/SharedConstants.swift new file mode 100644 index 00000000..c662d07f --- /dev/null +++ b/AirSyncWidget/SharedConstants.swift @@ -0,0 +1,24 @@ +// +// SharedConstants.swift +// Shared between AirSync and AirSyncWidget +// + +import Foundation + +let APP_GROUP_IDENTIFIER = "group.sameerasw.airsync-mac.widget" + +let WIDGET_DATA_KEYS = ( + deviceName: "deviceName", + batteryLevel: "batteryLevel", + isCharging: "isCharging", + isPaired: "isPaired", + isLocalNetwork: "isLocalNetwork", + isBLEConnected: "isBLEConnected", + isADBConnected: "isADBConnected", + adbMode: "adbMode", + wallpaperBase64: "wallpaperBase64", + isMusicPlaying: "isMusicPlaying", + musicTitle: "musicTitle", + musicArtist: "musicArtist", + musicAlbumArt: "musicAlbumArt" +) diff --git a/AirSyncWidgetExtension.entitlements b/AirSyncWidgetExtension.entitlements new file mode 100644 index 00000000..864feab7 --- /dev/null +++ b/AirSyncWidgetExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.sameerasw.airsync-mac.widget + + + diff --git a/airsync-mac/Core/AppState.swift b/airsync-mac/Core/AppState.swift index 752099e5..51d4f4f8 100644 --- a/airsync-mac/Core/AppState.swift +++ b/airsync-mac/Core/AppState.swift @@ -349,9 +349,16 @@ class AppState: ObservableObject { activeCallDurationSec = 0 } @Published var status: DeviceStatus? = nil { - didSet { syncMediaTimerToPlayState() } + didSet { + syncMediaTimerToPlayState() + updateWidgetData() + } + } + @Published var myDevice: Device? = nil { + didSet { + updateWidgetData() + } } - @Published var myDevice: Device? = nil @Published var port: UInt16 = Defaults.serverPort @Published var androidApps: [String: AndroidApp] = [:] @Published var notificationLaunchPreferences: [String: MacAppLaunchPreference] = [:] @@ -1974,4 +1981,17 @@ class AppState: ObservableObject { syncMediaPosition(incoming: pos) } } + + private func updateWidgetData() { + let deviceName = device?.name ?? "Your Phone" + WidgetDataManager.shared.updateWidgetData( + deviceStatus: status, + deviceName: deviceName, + wallpaperBase64: currentDeviceWallpaperBase64, + isLocalNetwork: isConnectedOverLocalNetwork, + isBLEConnected: BLECentralManager.shared.isAuthenticated, + isADBConnected: adbConnected, + adbMode: adbConnectionMode?.rawValue ?? "wireless" + ) + } } diff --git a/airsync-mac/Core/BLE/BLECentralManager.swift b/airsync-mac/Core/BLE/BLECentralManager.swift index ed33f18d..4d43537a 100644 --- a/airsync-mac/Core/BLE/BLECentralManager.swift +++ b/airsync-mac/Core/BLE/BLECentralManager.swift @@ -111,19 +111,21 @@ class BLECentralManager: NSObject, ObservableObject { // Restart scan periodically to avoid stale states scanTimer = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: true) { [weak self] _ in - guard let self = self else { return } - // Skip restart cycle when already connected — nothing to rediscover - guard self.connectionStatus == .scanning else { return } - - // Prune stale devices older than 25 seconds - let now = Date() - let staleUUIDs = self.discoveredPeripherals.filter { now.timeIntervalSince($1.lastSeen) > 15.0 }.map { $0.key } - for uuid in staleUUIDs { - self.discoveredPeripherals.removeValue(forKey: uuid) + MainActor.assumeIsolated { + guard let self = self else { return } + // Skip restart cycle when already connected — nothing to rediscover + guard self.connectionStatus == .scanning else { return } + + // Prune stale devices older than 25 seconds + let now = Date() + let staleUUIDs = self.discoveredPeripherals.filter { now.timeIntervalSince($1.lastSeen) > 15.0 }.map { $0.key } + for uuid in staleUUIDs { + self.discoveredPeripherals.removeValue(forKey: uuid) + } + + self.centralManager.stopScan() + self.centralManager.scanForPeripherals(withServices: [BLEConstants.serviceSystem], options: [CBCentralManagerScanOptionAllowDuplicatesKey: false]) } - - self.centralManager.stopScan() - self.centralManager.scanForPeripherals(withServices: [BLEConstants.serviceSystem], options: [CBCentralManagerScanOptionAllowDuplicatesKey: false]) } } @@ -240,9 +242,9 @@ class BLECentralManager: NSObject, ObservableObject { } private func resetWatchdog() { - DispatchQueue.main.async { - self.watchdogTimer?.invalidate() - self.watchdogTimer = Timer.scheduledTimer(withTimeInterval: 120.0, repeats: false) { [weak self] _ in + DispatchQueue.main.async { [weak self] in + self?.watchdogTimer?.invalidate() + self?.watchdogTimer = Timer.scheduledTimer(withTimeInterval: 120.0, repeats: false) { [weak self] _ in print("[BLE] Heartbeat timeout (120s), disconnecting...") self?.disconnect() } diff --git a/airsync-mac/Core/Discovery/DiscoveryManager.swift b/airsync-mac/Core/Discovery/DiscoveryManager.swift index 680576b2..a3386190 100644 --- a/airsync-mac/Core/Discovery/DiscoveryManager.swift +++ b/airsync-mac/Core/Discovery/DiscoveryManager.swift @@ -88,7 +88,8 @@ class DiscoveryManager: ObservableObject { // Verify TCP reachability over Wi-Fi socket before exposing to UI or auto-switching verifyIPReachability(ip: bestIP, port: detected.port) { [weak self] isReachable in guard let self = self else { return } - DispatchQueue.main.async { + DispatchQueue.main.async { [weak self] in + guard let self = self else { return } guard isReachable else { print("[DiscoveryManager] Discovered Wi-Fi device (\(detected.name)) is NOT reachable over TCP at \(bestIP):\(detected.port). Ignoring stale mDNS record.") self.availableWifiDeviceForCurrentBLE = nil @@ -324,9 +325,9 @@ class DiscoveryManager: ObservableObject { } private func startReachabilityTimer() { - DispatchQueue.main.async { - self.reachabilityTimer?.invalidate() - self.reachabilityTimer = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: true) { [weak self] _ in + DispatchQueue.main.async { [weak self] in + self?.reachabilityTimer?.invalidate() + self?.reachabilityTimer = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: true) { [weak self] _ in self?.checkMdnsDevicesReachability() } } diff --git a/airsync-mac/Core/Discovery/UdpBroadcastDiscovery.swift b/airsync-mac/Core/Discovery/UdpBroadcastDiscovery.swift index 2f3389ac..7630fb2a 100644 --- a/airsync-mac/Core/Discovery/UdpBroadcastDiscovery.swift +++ b/airsync-mac/Core/Discovery/UdpBroadcastDiscovery.swift @@ -386,7 +386,6 @@ class UdpBroadcastDiscovery: ObservableObject { DispatchQueue.main.async { withAnimation(.easeInOut(duration: 0.6)) { - let initialCount = self.discoveredDevices.count self.discoveredDevices = self.discoveredDevices.filter { now.timeIntervalSince($0.lastSeen) <= 35 } diff --git a/airsync-mac/Core/QuickShare/GenerateProtobuf.sh b/airsync-mac/Core/QuickShare/GenerateProtobuf.sh new file mode 100755 index 00000000..964aa887 --- /dev/null +++ b/airsync-mac/Core/QuickShare/GenerateProtobuf.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ls ProtobufSource | xargs protoc --swift_out=Protobuf --proto_path=ProtobufSource diff --git a/airsync-mac/Core/QuickShare/Protobuf/device_to_device_messages.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/device_to_device_messages.pb.swift index f978a9dc..85988a20 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/device_to_device_messages.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/device_to_device_messages.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: device_to_device_messages.proto @@ -21,7 +22,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif @preconcurrency import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -30,65 +35,43 @@ import Foundation // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// Type of curve -enum Securegcm_Curve: SwiftProtobuf.Enum { - typealias RawValue = Int - case ed25519 // = 1 +enum Securegcm_Curve: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case ed25519 = 1 init() { self = .ed25519 } - init?(rawValue: Int) { - switch rawValue { - case 1: self = .ed25519 - default: return nil - } - } - - var rawValue: Int { - switch self { - case .ed25519: return 1 - } - } - } -#if swift(>=4.2) - -extension Securegcm_Curve: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// Used by protocols between devices -struct Securegcm_DeviceToDeviceMessage { +nonisolated struct Securegcm_DeviceToDeviceMessage: Sendable { // 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. /// the payload of the message var message: Data { - get {return _message ?? Data()} + get {_message ?? Data()} set {_message = newValue} } /// Returns true if `message` has been explicitly set. - var hasMessage: Bool {return self._message != nil} + var hasMessage: Bool {self._message != nil} /// Clears the value of `message`. Subsequent reads from it will return its default value. mutating func clearMessage() {self._message = nil} /// the sequence number of the message - must be increasing. var sequenceNumber: Int32 { - get {return _sequenceNumber ?? 0} + get {_sequenceNumber ?? 0} set {_sequenceNumber = newValue} } /// Returns true if `sequenceNumber` has been explicitly set. - var hasSequenceNumber: Bool {return self._sequenceNumber != nil} + var hasSequenceNumber: Bool {self._sequenceNumber != nil} /// Clears the value of `sequenceNumber`. Subsequent reads from it will return its default value. mutating func clearSequenceNumber() {self._sequenceNumber = nil} @@ -102,28 +85,28 @@ struct Securegcm_DeviceToDeviceMessage { /// sent as the first message from initiator to responder /// in an unauthenticated Diffie-Hellman Key Exchange -struct Securegcm_InitiatorHello { +nonisolated struct Securegcm_InitiatorHello: Sendable { // 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. /// The session public key to send to the responder var publicDhKey: Securemessage_GenericPublicKey { - get {return _publicDhKey ?? Securemessage_GenericPublicKey()} + get {_publicDhKey ?? Securemessage_GenericPublicKey()} set {_publicDhKey = newValue} } /// Returns true if `publicDhKey` has been explicitly set. - var hasPublicDhKey: Bool {return self._publicDhKey != nil} + var hasPublicDhKey: Bool {self._publicDhKey != nil} /// Clears the value of `publicDhKey`. Subsequent reads from it will return its default value. mutating func clearPublicDhKey() {self._publicDhKey = nil} /// The protocol version var protocolVersion: Int32 { - get {return _protocolVersion ?? 0} + get {_protocolVersion ?? 0} set {_protocolVersion = newValue} } /// Returns true if `protocolVersion` has been explicitly set. - var hasProtocolVersion: Bool {return self._protocolVersion != nil} + var hasProtocolVersion: Bool {self._protocolVersion != nil} /// Clears the value of `protocolVersion`. Subsequent reads from it will return its default value. mutating func clearProtocolVersion() {self._protocolVersion = nil} @@ -137,28 +120,28 @@ struct Securegcm_InitiatorHello { /// sent inside the header of the first message from the responder to the /// initiator in an unauthenticated Diffie-Hellman Key Exchange -struct Securegcm_ResponderHello { +nonisolated struct Securegcm_ResponderHello: Sendable { // 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. /// The session public key to send to the initiator var publicDhKey: Securemessage_GenericPublicKey { - get {return _publicDhKey ?? Securemessage_GenericPublicKey()} + get {_publicDhKey ?? Securemessage_GenericPublicKey()} set {_publicDhKey = newValue} } /// Returns true if `publicDhKey` has been explicitly set. - var hasPublicDhKey: Bool {return self._publicDhKey != nil} + var hasPublicDhKey: Bool {self._publicDhKey != nil} /// Clears the value of `publicDhKey`. Subsequent reads from it will return its default value. mutating func clearPublicDhKey() {self._publicDhKey = nil} /// The protocol version var protocolVersion: Int32 { - get {return _protocolVersion ?? 0} + get {_protocolVersion ?? 0} set {_protocolVersion = newValue} } /// Returns true if `protocolVersion` has been explicitly set. - var hasProtocolVersion: Bool {return self._protocolVersion != nil} + var hasProtocolVersion: Bool {self._protocolVersion != nil} /// Clears the value of `protocolVersion`. Subsequent reads from it will return its default value. mutating func clearProtocolVersion() {self._protocolVersion = nil} @@ -171,37 +154,37 @@ struct Securegcm_ResponderHello { } /// A convenience proto for encoding curve points in affine representation -struct Securegcm_EcPoint { +nonisolated struct Securegcm_EcPoint: Sendable { // 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 curve: Securegcm_Curve { - get {return _curve ?? .ed25519} + get {_curve ?? .ed25519} set {_curve = newValue} } /// Returns true if `curve` has been explicitly set. - var hasCurve: Bool {return self._curve != nil} + var hasCurve: Bool {self._curve != nil} /// Clears the value of `curve`. Subsequent reads from it will return its default value. mutating func clearCurve() {self._curve = nil} /// x and y are encoded in big-endian two's complement /// client MUST verify (x,y) is a valid point on the specified curve var x: Data { - get {return _x ?? Data()} + get {_x ?? Data()} set {_x = newValue} } /// Returns true if `x` has been explicitly set. - var hasX: Bool {return self._x != nil} + var hasX: Bool {self._x != nil} /// Clears the value of `x`. Subsequent reads from it will return its default value. mutating func clearX() {self._x = nil} var y: Data { - get {return _y ?? Data()} + get {_y ?? Data()} set {_y = newValue} } /// Returns true if `y` has been explicitly set. - var hasY: Bool {return self._y != nil} + var hasY: Bool {self._y != nil} /// Clears the value of `y`. Subsequent reads from it will return its default value. mutating func clearY() {self._y = nil} @@ -214,49 +197,49 @@ struct Securegcm_EcPoint { fileprivate var _y: Data? = nil } -struct Securegcm_SpakeHandshakeMessage { +nonisolated struct Securegcm_SpakeHandshakeMessage: Sendable { // 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. /// Each flow in the protocol bumps this counter var flowNumber: Int32 { - get {return _flowNumber ?? 0} + get {_flowNumber ?? 0} set {_flowNumber = newValue} } /// Returns true if `flowNumber` has been explicitly set. - var hasFlowNumber: Bool {return self._flowNumber != nil} + var hasFlowNumber: Bool {self._flowNumber != nil} /// Clears the value of `flowNumber`. Subsequent reads from it will return its default value. mutating func clearFlowNumber() {self._flowNumber = nil} /// Some (but not all) SPAKE flows send a point on an elliptic curve var ecPoint: Securegcm_EcPoint { - get {return _ecPoint ?? Securegcm_EcPoint()} + get {_ecPoint ?? Securegcm_EcPoint()} set {_ecPoint = newValue} } /// Returns true if `ecPoint` has been explicitly set. - var hasEcPoint: Bool {return self._ecPoint != nil} + var hasEcPoint: Bool {self._ecPoint != nil} /// Clears the value of `ecPoint`. Subsequent reads from it will return its default value. mutating func clearEcPoint() {self._ecPoint = nil} /// Some (but not all) SPAKE flows send a hash value var hashValue_p: Data { - get {return _hashValue_p ?? Data()} + get {_hashValue_p ?? Data()} set {_hashValue_p = newValue} } /// Returns true if `hashValue_p` has been explicitly set. - var hasHashValue_p: Bool {return self._hashValue_p != nil} + var hasHashValue_p: Bool {self._hashValue_p != nil} /// Clears the value of `hashValue_p`. Subsequent reads from it will return its default value. mutating func clearHashValue_p() {self._hashValue_p = nil} /// The last flow of a SPAKE protocol can send an optional payload, /// since the key exchange is already complete on the sender's side. var payload: Data { - get {return _payload ?? Data()} + get {_payload ?? Data()} set {_payload = newValue} } /// Returns true if `payload` has been explicitly set. - var hasPayload: Bool {return self._payload != nil} + var hasPayload: Bool {self._payload != nil} /// Clears the value of `payload`. Subsequent reads from it will return its default value. mutating func clearPayload() {self._payload = nil} @@ -270,31 +253,17 @@ struct Securegcm_SpakeHandshakeMessage { fileprivate var _payload: Data? = nil } -#if swift(>=5.5) && canImport(_Concurrency) -extension Securegcm_Curve: @unchecked Sendable {} -extension Securegcm_DeviceToDeviceMessage: @unchecked Sendable {} -extension Securegcm_InitiatorHello: @unchecked Sendable {} -extension Securegcm_ResponderHello: @unchecked Sendable {} -extension Securegcm_EcPoint: @unchecked Sendable {} -extension Securegcm_SpakeHandshakeMessage: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "securegcm" +nonisolated fileprivate let _protobuf_package = "securegcm" -extension Securegcm_Curve: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "ED_25519"), - ] +nonisolated extension Securegcm_Curve: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ED_25519\0") } -extension Securegcm_DeviceToDeviceMessage: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_DeviceToDeviceMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".DeviceToDeviceMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "message"), - 2: .standard(proto: "sequence_number"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}message\0\u{3}sequence_number\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -331,12 +300,9 @@ extension Securegcm_DeviceToDeviceMessage: @preconcurrency SwiftProtobuf.Message } } -extension Securegcm_InitiatorHello: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_InitiatorHello: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".InitiatorHello" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "public_dh_key"), - 2: .standard(proto: "protocol_version"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_dh_key\0\u{3}protocol_version\0") public var isInitialized: Bool { if let v = self._publicDhKey, !v.isInitialized {return false} @@ -378,12 +344,9 @@ extension Securegcm_InitiatorHello: @preconcurrency SwiftProtobuf.Message, @prec } } -extension Securegcm_ResponderHello: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_ResponderHello: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ResponderHello" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "public_dh_key"), - 2: .standard(proto: "protocol_version"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_dh_key\0\u{3}protocol_version\0") public var isInitialized: Bool { if let v = self._publicDhKey, !v.isInitialized {return false} @@ -425,13 +388,9 @@ extension Securegcm_ResponderHello: @preconcurrency SwiftProtobuf.Message, @prec } } -extension Securegcm_EcPoint: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_EcPoint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".EcPoint" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "curve"), - 2: .same(proto: "x"), - 3: .same(proto: "y"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}curve\0\u{1}x\0\u{1}y\0") public var isInitialized: Bool { if self._curve == nil {return false} @@ -480,14 +439,9 @@ extension Securegcm_EcPoint: @preconcurrency SwiftProtobuf.Message, @preconcurre } } -extension Securegcm_SpakeHandshakeMessage: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_SpakeHandshakeMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".SpakeHandshakeMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "flow_number"), - 2: .standard(proto: "ec_point"), - 3: .standard(proto: "hash_value"), - 4: .same(proto: "payload"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}flow_number\0\u{3}ec_point\0\u{3}hash_value\0\u{1}payload\0") public var isInitialized: Bool { if let v = self._ecPoint, !v.isInitialized {return false} diff --git a/airsync-mac/Core/QuickShare/Protobuf/offline_wire_formats.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/offline_wire_formats.pb.swift index 023f2fc0..a36a4205 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/offline_wire_formats.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/offline_wire_formats.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: offline_wire_formats.proto @@ -21,7 +22,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif @preconcurrency import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -30,98 +35,56 @@ import Foundation // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } -enum Location_Nearby_Connections_EndpointType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownEndpoint // = 0 - case connectionsEndpoint // = 1 - case presenceEndpoint // = 2 +enum Location_Nearby_Connections_EndpointType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownEndpoint = 0 + case connectionsEndpoint = 1 + case presenceEndpoint = 2 init() { self = .unknownEndpoint } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownEndpoint - case 1: self = .connectionsEndpoint - case 2: self = .presenceEndpoint - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownEndpoint: return 0 - case .connectionsEndpoint: return 1 - case .presenceEndpoint: return 2 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Connections_EndpointType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_OfflineFrame { +nonisolated struct Location_Nearby_Connections_OfflineFrame: Sendable { // 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 version: Location_Nearby_Connections_OfflineFrame.Version { - get {return _version ?? .unknownVersion} + get {_version ?? .unknownVersion} set {_version = newValue} } /// Returns true if `version` has been explicitly set. - var hasVersion: Bool {return self._version != nil} + var hasVersion: Bool {self._version != nil} /// Clears the value of `version`. Subsequent reads from it will return its default value. mutating func clearVersion() {self._version = nil} /// Right now there's only 1 version, but if there are more, exactly one of /// the following fields will be set. var v1: Location_Nearby_Connections_V1Frame { - get {return _v1 ?? Location_Nearby_Connections_V1Frame()} + get {_v1 ?? Location_Nearby_Connections_V1Frame()} set {_v1 = newValue} } /// Returns true if `v1` has been explicitly set. - var hasV1: Bool {return self._v1 != nil} + var hasV1: Bool {self._v1 != nil} /// Clears the value of `v1`. Subsequent reads from it will return its default value. mutating func clearV1() {self._v1 = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum Version: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownVersion // = 0 - case v1 // = 1 + enum Version: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownVersion = 0 + case v1 = 1 init() { self = .unknownVersion } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownVersion - case 1: self = .v1 - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownVersion: return 0 - case .v1: return 1 - } - } - } init() {} @@ -130,196 +93,150 @@ struct Location_Nearby_Connections_OfflineFrame { fileprivate var _v1: Location_Nearby_Connections_V1Frame? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_OfflineFrame.Version: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_V1Frame { +nonisolated struct Location_Nearby_Connections_V1Frame: @unchecked Sendable { // 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 type: Location_Nearby_Connections_V1Frame.FrameType { - get {return _storage._type ?? .unknownFrameType} + get {_storage._type ?? .unknownFrameType} set {_uniqueStorage()._type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return _storage._type != nil} + var hasType: Bool {_storage._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {_uniqueStorage()._type = nil} /// Exactly one of the following fields will be set. var connectionRequest: Location_Nearby_Connections_ConnectionRequestFrame { - get {return _storage._connectionRequest ?? Location_Nearby_Connections_ConnectionRequestFrame()} + get {_storage._connectionRequest ?? Location_Nearby_Connections_ConnectionRequestFrame()} set {_uniqueStorage()._connectionRequest = newValue} } /// Returns true if `connectionRequest` has been explicitly set. - var hasConnectionRequest: Bool {return _storage._connectionRequest != nil} + var hasConnectionRequest: Bool {_storage._connectionRequest != nil} /// Clears the value of `connectionRequest`. Subsequent reads from it will return its default value. mutating func clearConnectionRequest() {_uniqueStorage()._connectionRequest = nil} var connectionResponse: Location_Nearby_Connections_ConnectionResponseFrame { - get {return _storage._connectionResponse ?? Location_Nearby_Connections_ConnectionResponseFrame()} + get {_storage._connectionResponse ?? Location_Nearby_Connections_ConnectionResponseFrame()} set {_uniqueStorage()._connectionResponse = newValue} } /// Returns true if `connectionResponse` has been explicitly set. - var hasConnectionResponse: Bool {return _storage._connectionResponse != nil} + var hasConnectionResponse: Bool {_storage._connectionResponse != nil} /// Clears the value of `connectionResponse`. Subsequent reads from it will return its default value. mutating func clearConnectionResponse() {_uniqueStorage()._connectionResponse = nil} var payloadTransfer: Location_Nearby_Connections_PayloadTransferFrame { - get {return _storage._payloadTransfer ?? Location_Nearby_Connections_PayloadTransferFrame()} + get {_storage._payloadTransfer ?? Location_Nearby_Connections_PayloadTransferFrame()} set {_uniqueStorage()._payloadTransfer = newValue} } /// Returns true if `payloadTransfer` has been explicitly set. - var hasPayloadTransfer: Bool {return _storage._payloadTransfer != nil} + var hasPayloadTransfer: Bool {_storage._payloadTransfer != nil} /// Clears the value of `payloadTransfer`. Subsequent reads from it will return its default value. mutating func clearPayloadTransfer() {_uniqueStorage()._payloadTransfer = nil} var bandwidthUpgradeNegotiation: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { - get {return _storage._bandwidthUpgradeNegotiation ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame()} + get {_storage._bandwidthUpgradeNegotiation ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame()} set {_uniqueStorage()._bandwidthUpgradeNegotiation = newValue} } /// Returns true if `bandwidthUpgradeNegotiation` has been explicitly set. - var hasBandwidthUpgradeNegotiation: Bool {return _storage._bandwidthUpgradeNegotiation != nil} + var hasBandwidthUpgradeNegotiation: Bool {_storage._bandwidthUpgradeNegotiation != nil} /// Clears the value of `bandwidthUpgradeNegotiation`. Subsequent reads from it will return its default value. mutating func clearBandwidthUpgradeNegotiation() {_uniqueStorage()._bandwidthUpgradeNegotiation = nil} var keepAlive: Location_Nearby_Connections_KeepAliveFrame { - get {return _storage._keepAlive ?? Location_Nearby_Connections_KeepAliveFrame()} + get {_storage._keepAlive ?? Location_Nearby_Connections_KeepAliveFrame()} set {_uniqueStorage()._keepAlive = newValue} } /// Returns true if `keepAlive` has been explicitly set. - var hasKeepAlive: Bool {return _storage._keepAlive != nil} + var hasKeepAlive: Bool {_storage._keepAlive != nil} /// Clears the value of `keepAlive`. Subsequent reads from it will return its default value. mutating func clearKeepAlive() {_uniqueStorage()._keepAlive = nil} var disconnection: Location_Nearby_Connections_DisconnectionFrame { - get {return _storage._disconnection ?? Location_Nearby_Connections_DisconnectionFrame()} + get {_storage._disconnection ?? Location_Nearby_Connections_DisconnectionFrame()} set {_uniqueStorage()._disconnection = newValue} } /// Returns true if `disconnection` has been explicitly set. - var hasDisconnection: Bool {return _storage._disconnection != nil} + var hasDisconnection: Bool {_storage._disconnection != nil} /// Clears the value of `disconnection`. Subsequent reads from it will return its default value. mutating func clearDisconnection() {_uniqueStorage()._disconnection = nil} var pairedKeyEncryption: Location_Nearby_Connections_PairedKeyEncryptionFrame { - get {return _storage._pairedKeyEncryption ?? Location_Nearby_Connections_PairedKeyEncryptionFrame()} + get {_storage._pairedKeyEncryption ?? Location_Nearby_Connections_PairedKeyEncryptionFrame()} set {_uniqueStorage()._pairedKeyEncryption = newValue} } /// Returns true if `pairedKeyEncryption` has been explicitly set. - var hasPairedKeyEncryption: Bool {return _storage._pairedKeyEncryption != nil} + var hasPairedKeyEncryption: Bool {_storage._pairedKeyEncryption != nil} /// Clears the value of `pairedKeyEncryption`. Subsequent reads from it will return its default value. mutating func clearPairedKeyEncryption() {_uniqueStorage()._pairedKeyEncryption = nil} var authenticationMessage: Location_Nearby_Connections_AuthenticationMessageFrame { - get {return _storage._authenticationMessage ?? Location_Nearby_Connections_AuthenticationMessageFrame()} + get {_storage._authenticationMessage ?? Location_Nearby_Connections_AuthenticationMessageFrame()} set {_uniqueStorage()._authenticationMessage = newValue} } /// Returns true if `authenticationMessage` has been explicitly set. - var hasAuthenticationMessage: Bool {return _storage._authenticationMessage != nil} + var hasAuthenticationMessage: Bool {_storage._authenticationMessage != nil} /// Clears the value of `authenticationMessage`. Subsequent reads from it will return its default value. mutating func clearAuthenticationMessage() {_uniqueStorage()._authenticationMessage = nil} var authenticationResult: Location_Nearby_Connections_AuthenticationResultFrame { - get {return _storage._authenticationResult ?? Location_Nearby_Connections_AuthenticationResultFrame()} + get {_storage._authenticationResult ?? Location_Nearby_Connections_AuthenticationResultFrame()} set {_uniqueStorage()._authenticationResult = newValue} } /// Returns true if `authenticationResult` has been explicitly set. - var hasAuthenticationResult: Bool {return _storage._authenticationResult != nil} + var hasAuthenticationResult: Bool {_storage._authenticationResult != nil} /// Clears the value of `authenticationResult`. Subsequent reads from it will return its default value. mutating func clearAuthenticationResult() {_uniqueStorage()._authenticationResult = nil} var autoResume: Location_Nearby_Connections_AutoResumeFrame { - get {return _storage._autoResume ?? Location_Nearby_Connections_AutoResumeFrame()} + get {_storage._autoResume ?? Location_Nearby_Connections_AutoResumeFrame()} set {_uniqueStorage()._autoResume = newValue} } /// Returns true if `autoResume` has been explicitly set. - var hasAutoResume: Bool {return _storage._autoResume != nil} + var hasAutoResume: Bool {_storage._autoResume != nil} /// Clears the value of `autoResume`. Subsequent reads from it will return its default value. mutating func clearAutoResume() {_uniqueStorage()._autoResume = nil} var autoReconnect: Location_Nearby_Connections_AutoReconnectFrame { - get {return _storage._autoReconnect ?? Location_Nearby_Connections_AutoReconnectFrame()} + get {_storage._autoReconnect ?? Location_Nearby_Connections_AutoReconnectFrame()} set {_uniqueStorage()._autoReconnect = newValue} } /// Returns true if `autoReconnect` has been explicitly set. - var hasAutoReconnect: Bool {return _storage._autoReconnect != nil} + var hasAutoReconnect: Bool {_storage._autoReconnect != nil} /// Clears the value of `autoReconnect`. Subsequent reads from it will return its default value. mutating func clearAutoReconnect() {_uniqueStorage()._autoReconnect = nil} var bandwidthUpgradeRetry: Location_Nearby_Connections_BandwidthUpgradeRetryFrame { - get {return _storage._bandwidthUpgradeRetry ?? Location_Nearby_Connections_BandwidthUpgradeRetryFrame()} + get {_storage._bandwidthUpgradeRetry ?? Location_Nearby_Connections_BandwidthUpgradeRetryFrame()} set {_uniqueStorage()._bandwidthUpgradeRetry = newValue} } /// Returns true if `bandwidthUpgradeRetry` has been explicitly set. - var hasBandwidthUpgradeRetry: Bool {return _storage._bandwidthUpgradeRetry != nil} + var hasBandwidthUpgradeRetry: Bool {_storage._bandwidthUpgradeRetry != nil} /// Clears the value of `bandwidthUpgradeRetry`. Subsequent reads from it will return its default value. mutating func clearBandwidthUpgradeRetry() {_uniqueStorage()._bandwidthUpgradeRetry = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum FrameType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownFrameType // = 0 - case connectionRequest // = 1 - case connectionResponse // = 2 - case payloadTransfer // = 3 - case bandwidthUpgradeNegotiation // = 4 - case keepAlive // = 5 - case disconnection // = 6 - case pairedKeyEncryption // = 7 - case authenticationMessage // = 8 - case authenticationResult // = 9 - case autoResume // = 10 - case autoReconnect // = 11 - case bandwidthUpgradeRetry // = 12 + enum FrameType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownFrameType = 0 + case connectionRequest = 1 + case connectionResponse = 2 + case payloadTransfer = 3 + case bandwidthUpgradeNegotiation = 4 + case keepAlive = 5 + case disconnection = 6 + case pairedKeyEncryption = 7 + case authenticationMessage = 8 + case authenticationResult = 9 + case autoResume = 10 + case autoReconnect = 11 + case bandwidthUpgradeRetry = 12 init() { self = .unknownFrameType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownFrameType - case 1: self = .connectionRequest - case 2: self = .connectionResponse - case 3: self = .payloadTransfer - case 4: self = .bandwidthUpgradeNegotiation - case 5: self = .keepAlive - case 6: self = .disconnection - case 7: self = .pairedKeyEncryption - case 8: self = .authenticationMessage - case 9: self = .authenticationResult - case 10: self = .autoResume - case 11: self = .autoReconnect - case 12: self = .bandwidthUpgradeRetry - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownFrameType: return 0 - case .connectionRequest: return 1 - case .connectionResponse: return 2 - case .payloadTransfer: return 3 - case .bandwidthUpgradeNegotiation: return 4 - case .keepAlive: return 5 - case .disconnection: return 6 - case .pairedKeyEncryption: return 7 - case .authenticationMessage: return 8 - case .authenticationResult: return 9 - case .autoResume: return 10 - case .autoReconnect: return 11 - case .bandwidthUpgradeRetry: return 12 - } - } - } init() {} @@ -327,43 +244,35 @@ struct Location_Nearby_Connections_V1Frame { fileprivate var _storage = _StorageClass.defaultInstance } -#if swift(>=4.2) - -extension Location_Nearby_Connections_V1Frame.FrameType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_ConnectionRequestFrame { +nonisolated struct Location_Nearby_Connections_ConnectionRequestFrame: @unchecked Sendable { // 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 endpointID: String { - get {return _storage._endpointID ?? String()} + get {_storage._endpointID ?? String()} set {_uniqueStorage()._endpointID = newValue} } /// Returns true if `endpointID` has been explicitly set. - var hasEndpointID: Bool {return _storage._endpointID != nil} + var hasEndpointID: Bool {_storage._endpointID != nil} /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. mutating func clearEndpointID() {_uniqueStorage()._endpointID = nil} var endpointName: String { - get {return _storage._endpointName ?? String()} + get {_storage._endpointName ?? String()} set {_uniqueStorage()._endpointName = newValue} } /// Returns true if `endpointName` has been explicitly set. - var hasEndpointName: Bool {return _storage._endpointName != nil} + var hasEndpointName: Bool {_storage._endpointName != nil} /// Clears the value of `endpointName`. Subsequent reads from it will return its default value. mutating func clearEndpointName() {_uniqueStorage()._endpointName = nil} var handshakeData: Data { - get {return _storage._handshakeData ?? Data()} + get {_storage._handshakeData ?? Data()} set {_uniqueStorage()._handshakeData = newValue} } /// Returns true if `handshakeData` has been explicitly set. - var hasHandshakeData: Bool {return _storage._handshakeData != nil} + var hasHandshakeData: Bool {_storage._handshakeData != nil} /// Clears the value of `handshakeData`. Subsequent reads from it will return its default value. mutating func clearHandshakeData() {_uniqueStorage()._handshakeData = nil} @@ -372,74 +281,78 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { /// simultaneously; this can also be used for other initialization-scoped /// things in the future. var nonce: Int32 { - get {return _storage._nonce ?? 0} + get {_storage._nonce ?? 0} set {_uniqueStorage()._nonce = newValue} } /// Returns true if `nonce` has been explicitly set. - var hasNonce: Bool {return _storage._nonce != nil} + var hasNonce: Bool {_storage._nonce != nil} /// Clears the value of `nonce`. Subsequent reads from it will return its default value. mutating func clearNonce() {_uniqueStorage()._nonce = nil} /// The mediums this device supports upgrading to. This list should be filtered /// by both the strategy and this device's individual limitations. var mediums: [Location_Nearby_Connections_ConnectionRequestFrame.Medium] { - get {return _storage._mediums} + get {_storage._mediums} set {_uniqueStorage()._mediums = newValue} } var endpointInfo: Data { - get {return _storage._endpointInfo ?? Data()} + get {_storage._endpointInfo ?? Data()} set {_uniqueStorage()._endpointInfo = newValue} } /// Returns true if `endpointInfo` has been explicitly set. - var hasEndpointInfo: Bool {return _storage._endpointInfo != nil} + var hasEndpointInfo: Bool {_storage._endpointInfo != nil} /// Clears the value of `endpointInfo`. Subsequent reads from it will return its default value. mutating func clearEndpointInfo() {_uniqueStorage()._endpointInfo = nil} var mediumMetadata: Location_Nearby_Connections_MediumMetadata { - get {return _storage._mediumMetadata ?? Location_Nearby_Connections_MediumMetadata()} + get {_storage._mediumMetadata ?? Location_Nearby_Connections_MediumMetadata()} set {_uniqueStorage()._mediumMetadata = newValue} } /// Returns true if `mediumMetadata` has been explicitly set. - var hasMediumMetadata: Bool {return _storage._mediumMetadata != nil} + var hasMediumMetadata: Bool {_storage._mediumMetadata != nil} /// Clears the value of `mediumMetadata`. Subsequent reads from it will return its default value. mutating func clearMediumMetadata() {_uniqueStorage()._mediumMetadata = nil} var keepAliveIntervalMillis: Int32 { - get {return _storage._keepAliveIntervalMillis ?? 0} + get {_storage._keepAliveIntervalMillis ?? 0} set {_uniqueStorage()._keepAliveIntervalMillis = newValue} } /// Returns true if `keepAliveIntervalMillis` has been explicitly set. - var hasKeepAliveIntervalMillis: Bool {return _storage._keepAliveIntervalMillis != nil} + var hasKeepAliveIntervalMillis: Bool {_storage._keepAliveIntervalMillis != nil} /// Clears the value of `keepAliveIntervalMillis`. Subsequent reads from it will return its default value. mutating func clearKeepAliveIntervalMillis() {_uniqueStorage()._keepAliveIntervalMillis = nil} var keepAliveTimeoutMillis: Int32 { - get {return _storage._keepAliveTimeoutMillis ?? 0} + get {_storage._keepAliveTimeoutMillis ?? 0} set {_uniqueStorage()._keepAliveTimeoutMillis = newValue} } /// Returns true if `keepAliveTimeoutMillis` has been explicitly set. - var hasKeepAliveTimeoutMillis: Bool {return _storage._keepAliveTimeoutMillis != nil} + var hasKeepAliveTimeoutMillis: Bool {_storage._keepAliveTimeoutMillis != nil} /// Clears the value of `keepAliveTimeoutMillis`. Subsequent reads from it will return its default value. mutating func clearKeepAliveTimeoutMillis() {_uniqueStorage()._keepAliveTimeoutMillis = nil} /// The type of {@link Device} object. + /// + /// NOTE: This field was marked as deprecated in the .proto file. var deviceType: Int32 { - get {return _storage._deviceType ?? 0} + get {_storage._deviceType ?? 0} set {_uniqueStorage()._deviceType = newValue} } /// Returns true if `deviceType` has been explicitly set. - var hasDeviceType: Bool {return _storage._deviceType != nil} + var hasDeviceType: Bool {_storage._deviceType != nil} /// Clears the value of `deviceType`. Subsequent reads from it will return its default value. mutating func clearDeviceType() {_uniqueStorage()._deviceType = nil} /// The bytes of serialized {@link Device} object. + /// + /// NOTE: This field was marked as deprecated in the .proto file. var deviceInfo: Data { - get {return _storage._deviceInfo ?? Data()} + get {_storage._deviceInfo ?? Data()} set {_uniqueStorage()._deviceInfo = newValue} } /// Returns true if `deviceInfo` has been explicitly set. - var hasDeviceInfo: Bool {return _storage._deviceInfo != nil} + var hasDeviceInfo: Bool {_storage._deviceInfo != nil} /// Clears the value of `deviceInfo`. Subsequent reads from it will return its default value. mutating func clearDeviceInfo() {_uniqueStorage()._deviceInfo = nil} @@ -466,139 +379,67 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { } var connectionMode: Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode { - get {return _storage._connectionMode ?? .legacy} + get {_storage._connectionMode ?? .legacy} set {_uniqueStorage()._connectionMode = newValue} } /// Returns true if `connectionMode` has been explicitly set. - var hasConnectionMode: Bool {return _storage._connectionMode != nil} + var hasConnectionMode: Bool {_storage._connectionMode != nil} /// Clears the value of `connectionMode`. Subsequent reads from it will return its default value. mutating func clearConnectionMode() {_uniqueStorage()._connectionMode = nil} var locationHint: Location_Nearby_Connections_LocationHint { - get {return _storage._locationHint ?? Location_Nearby_Connections_LocationHint()} + get {_storage._locationHint ?? Location_Nearby_Connections_LocationHint()} set {_uniqueStorage()._locationHint = newValue} } /// Returns true if `locationHint` has been explicitly set. - var hasLocationHint: Bool {return _storage._locationHint != nil} + var hasLocationHint: Bool {_storage._locationHint != nil} /// Clears the value of `locationHint`. Subsequent reads from it will return its default value. mutating func clearLocationHint() {_uniqueStorage()._locationHint = nil} var unknownFields = SwiftProtobuf.UnknownStorage() /// Represents the {@link Device} that invokes the request. - enum OneOf_Device: Equatable { + enum OneOf_Device: Equatable, Sendable { case connectionsDevice(Location_Nearby_Connections_ConnectionsDevice) case presenceDevice(Location_Nearby_Connections_PresenceDevice) - #if !swift(>=4.1) - static func ==(lhs: Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device, rhs: Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device) -> Bool { - // 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 (lhs, rhs) { - case (.connectionsDevice, .connectionsDevice): return { - guard case .connectionsDevice(let l) = lhs, case .connectionsDevice(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.presenceDevice, .presenceDevice): return { - guard case .presenceDevice(let l) = lhs, case .presenceDevice(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif } /// Should always match cs/symbol:location.nearby.proto.connections.Medium /// LINT.IfChange - enum Medium: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownMedium // = 0 - case mdns // = 1 - case bluetooth // = 2 - case wifiHotspot // = 3 - case ble // = 4 - case wifiLan // = 5 - case wifiAware // = 6 - case nfc // = 7 - case wifiDirect // = 8 - case webRtc // = 9 - case bleL2Cap // = 10 - case usb // = 11 - case webRtcNonCellular // = 12 - case awdl // = 13 + enum Medium: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownMedium = 0 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case mdns = 1 + case bluetooth = 2 + case wifiHotspot = 3 + case ble = 4 + case wifiLan = 5 + case wifiAware = 6 + case nfc = 7 + case wifiDirect = 8 + case webRtc = 9 + case bleL2Cap = 10 + case usb = 11 + case webRtcNonCellular = 12 + case awdl = 13 init() { self = .unknownMedium } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownMedium - case 1: self = .mdns - case 2: self = .bluetooth - case 3: self = .wifiHotspot - case 4: self = .ble - case 5: self = .wifiLan - case 6: self = .wifiAware - case 7: self = .nfc - case 8: self = .wifiDirect - case 9: self = .webRtc - case 10: self = .bleL2Cap - case 11: self = .usb - case 12: self = .webRtcNonCellular - case 13: self = .awdl - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownMedium: return 0 - case .mdns: return 1 - case .bluetooth: return 2 - case .wifiHotspot: return 3 - case .ble: return 4 - case .wifiLan: return 5 - case .wifiAware: return 6 - case .nfc: return 7 - case .wifiDirect: return 8 - case .webRtc: return 9 - case .bleL2Cap: return 10 - case .usb: return 11 - case .webRtcNonCellular: return 12 - case .awdl: return 13 - } - } - } /// LINT.IfChange - enum ConnectionMode: SwiftProtobuf.Enum { - typealias RawValue = Int - case legacy // = 0 - case instant // = 1 + enum ConnectionMode: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case legacy = 0 + case instant = 1 init() { self = .legacy } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .legacy - case 1: self = .instant - default: return nil - } - } - - var rawValue: Int { - switch self { - case .legacy: return 0 - case .instant: return 1 - } - } - } init() {} @@ -606,22 +447,10 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { fileprivate var _storage = _StorageClass.defaultInstance } -#if swift(>=4.2) - -extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: CaseIterable { - // Support synthesized by the compiler. -} - -extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// This doesn't need to send back endpoint_id and endpoint_name (like /// the ConnectionRequestFrame does) because those have already been /// transmitted out-of-band, at the time this endpoint was discovered. -struct Location_Nearby_Connections_ConnectionResponseFrame { +nonisolated struct Location_Nearby_Connections_ConnectionResponseFrame: Sendable { // 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. @@ -630,39 +459,41 @@ struct Location_Nearby_Connections_ConnectionResponseFrame { /// /// - ConnectionsStatusCodes.STATUS_OK /// - ConnectionsStatusCodes.STATUS_CONNECTION_REJECTED. + /// + /// NOTE: This field was marked as deprecated in the .proto file. var status: Int32 { - get {return _status ?? 0} + get {_status ?? 0} set {_status = newValue} } /// Returns true if `status` has been explicitly set. - var hasStatus: Bool {return self._status != nil} + var hasStatus: Bool {self._status != nil} /// Clears the value of `status`. Subsequent reads from it will return its default value. mutating func clearStatus() {self._status = nil} var handshakeData: Data { - get {return _handshakeData ?? Data()} + get {_handshakeData ?? Data()} set {_handshakeData = newValue} } /// Returns true if `handshakeData` has been explicitly set. - var hasHandshakeData: Bool {return self._handshakeData != nil} + var hasHandshakeData: Bool {self._handshakeData != nil} /// Clears the value of `handshakeData`. Subsequent reads from it will return its default value. mutating func clearHandshakeData() {self._handshakeData = nil} var response: Location_Nearby_Connections_ConnectionResponseFrame.ResponseStatus { - get {return _response ?? .unknownResponseStatus} + get {_response ?? .unknownResponseStatus} set {_response = newValue} } /// Returns true if `response` has been explicitly set. - var hasResponse: Bool {return self._response != nil} + var hasResponse: Bool {self._response != nil} /// Clears the value of `response`. Subsequent reads from it will return its default value. mutating func clearResponse() {self._response = nil} var osInfo: Location_Nearby_Connections_OsInfo { - get {return _osInfo ?? Location_Nearby_Connections_OsInfo()} + get {_osInfo ?? Location_Nearby_Connections_OsInfo()} set {_osInfo = newValue} } /// Returns true if `osInfo` has been explicitly set. - var hasOsInfo: Bool {return self._osInfo != nil} + var hasOsInfo: Bool {self._osInfo != nil} /// Clears the value of `osInfo`. Subsequent reads from it will return its default value. mutating func clearOsInfo() {self._osInfo = nil} @@ -672,47 +503,48 @@ struct Location_Nearby_Connections_ConnectionResponseFrame { /// means bt supports multiplex while 0x00 means not. Refer to ClientProxy.java /// for the bit usages. var multiplexSocketBitmask: Int32 { - get {return _multiplexSocketBitmask ?? 0} + get {_multiplexSocketBitmask ?? 0} set {_multiplexSocketBitmask = newValue} } /// Returns true if `multiplexSocketBitmask` has been explicitly set. - var hasMultiplexSocketBitmask: Bool {return self._multiplexSocketBitmask != nil} + var hasMultiplexSocketBitmask: Bool {self._multiplexSocketBitmask != nil} /// Clears the value of `multiplexSocketBitmask`. Subsequent reads from it will return its default value. mutating func clearMultiplexSocketBitmask() {self._multiplexSocketBitmask = nil} + /// NOTE: This field was marked as deprecated in the .proto file. var nearbyConnectionsVersion: Int32 { - get {return _nearbyConnectionsVersion ?? 0} + get {_nearbyConnectionsVersion ?? 0} set {_nearbyConnectionsVersion = newValue} } /// Returns true if `nearbyConnectionsVersion` has been explicitly set. - var hasNearbyConnectionsVersion: Bool {return self._nearbyConnectionsVersion != nil} + var hasNearbyConnectionsVersion: Bool {self._nearbyConnectionsVersion != nil} /// Clears the value of `nearbyConnectionsVersion`. Subsequent reads from it will return its default value. mutating func clearNearbyConnectionsVersion() {self._nearbyConnectionsVersion = nil} var safeToDisconnectVersion: Int32 { - get {return _safeToDisconnectVersion ?? 0} + get {_safeToDisconnectVersion ?? 0} set {_safeToDisconnectVersion = newValue} } /// Returns true if `safeToDisconnectVersion` has been explicitly set. - var hasSafeToDisconnectVersion: Bool {return self._safeToDisconnectVersion != nil} + var hasSafeToDisconnectVersion: Bool {self._safeToDisconnectVersion != nil} /// Clears the value of `safeToDisconnectVersion`. Subsequent reads from it will return its default value. mutating func clearSafeToDisconnectVersion() {self._safeToDisconnectVersion = nil} var locationHint: Location_Nearby_Connections_LocationHint { - get {return _locationHint ?? Location_Nearby_Connections_LocationHint()} + get {_locationHint ?? Location_Nearby_Connections_LocationHint()} set {_locationHint = newValue} } /// Returns true if `locationHint` has been explicitly set. - var hasLocationHint: Bool {return self._locationHint != nil} + var hasLocationHint: Bool {self._locationHint != nil} /// Clears the value of `locationHint`. Subsequent reads from it will return its default value. mutating func clearLocationHint() {self._locationHint = nil} var keepAliveTimeoutMillis: Int32 { - get {return _keepAliveTimeoutMillis ?? 0} + get {_keepAliveTimeoutMillis ?? 0} set {_keepAliveTimeoutMillis = newValue} } /// Returns true if `keepAliveTimeoutMillis` has been explicitly set. - var hasKeepAliveTimeoutMillis: Bool {return self._keepAliveTimeoutMillis != nil} + var hasKeepAliveTimeoutMillis: Bool {self._keepAliveTimeoutMillis != nil} /// Clears the value of `keepAliveTimeoutMillis`. Subsequent reads from it will return its default value. mutating func clearKeepAliveTimeoutMillis() {self._keepAliveTimeoutMillis = nil} @@ -722,33 +554,15 @@ struct Location_Nearby_Connections_ConnectionResponseFrame { /// Map ConnectionsStatusCodes.STATUS_OK to ACCEPT and /// ConnectionsStatusCodes.STATUS_CONNECTION_REJECTED to REJECT. /// Flag: connection_replace_status_with_response_connectionResponseFrame - enum ResponseStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownResponseStatus // = 0 - case accept // = 1 - case reject // = 2 + enum ResponseStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownResponseStatus = 0 + case accept = 1 + case reject = 2 init() { self = .unknownResponseStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownResponseStatus - case 1: self = .accept - case 2: self = .reject - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownResponseStatus: return 0 - case .accept: return 1 - case .reject: return 2 - } - } - } init() {} @@ -764,191 +578,143 @@ struct Location_Nearby_Connections_ConnectionResponseFrame { fileprivate var _keepAliveTimeoutMillis: Int32? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_ConnectionResponseFrame.ResponseStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_PayloadTransferFrame { +nonisolated struct Location_Nearby_Connections_PayloadTransferFrame: Sendable { // 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 packetType: Location_Nearby_Connections_PayloadTransferFrame.PacketType { - get {return _packetType ?? .unknownPacketType} + get {_packetType ?? .unknownPacketType} set {_packetType = newValue} } /// Returns true if `packetType` has been explicitly set. - var hasPacketType: Bool {return self._packetType != nil} + var hasPacketType: Bool {self._packetType != nil} /// Clears the value of `packetType`. Subsequent reads from it will return its default value. mutating func clearPacketType() {self._packetType = nil} var payloadHeader: Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader { - get {return _payloadHeader ?? Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader()} + get {_payloadHeader ?? Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader()} set {_payloadHeader = newValue} } /// Returns true if `payloadHeader` has been explicitly set. - var hasPayloadHeader: Bool {return self._payloadHeader != nil} + var hasPayloadHeader: Bool {self._payloadHeader != nil} /// Clears the value of `payloadHeader`. Subsequent reads from it will return its default value. mutating func clearPayloadHeader() {self._payloadHeader = nil} /// Exactly one of the following fields will be set, depending on the type. var payloadChunk: Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk { - get {return _payloadChunk ?? Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk()} + get {_payloadChunk ?? Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk()} set {_payloadChunk = newValue} } /// Returns true if `payloadChunk` has been explicitly set. - var hasPayloadChunk: Bool {return self._payloadChunk != nil} + var hasPayloadChunk: Bool {self._payloadChunk != nil} /// Clears the value of `payloadChunk`. Subsequent reads from it will return its default value. mutating func clearPayloadChunk() {self._payloadChunk = nil} var controlMessage: Location_Nearby_Connections_PayloadTransferFrame.ControlMessage { - get {return _controlMessage ?? Location_Nearby_Connections_PayloadTransferFrame.ControlMessage()} + get {_controlMessage ?? Location_Nearby_Connections_PayloadTransferFrame.ControlMessage()} set {_controlMessage = newValue} } /// Returns true if `controlMessage` has been explicitly set. - var hasControlMessage: Bool {return self._controlMessage != nil} + var hasControlMessage: Bool {self._controlMessage != nil} /// Clears the value of `controlMessage`. Subsequent reads from it will return its default value. mutating func clearControlMessage() {self._controlMessage = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum PacketType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownPacketType // = 0 - case data // = 1 - case control // = 2 - case payloadAck // = 3 + enum PacketType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownPacketType = 0 + case data = 1 + case control = 2 + case payloadAck = 3 init() { self = .unknownPacketType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownPacketType - case 1: self = .data - case 2: self = .control - case 3: self = .payloadAck - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownPacketType: return 0 - case .data: return 1 - case .control: return 2 - case .payloadAck: return 3 - } - } - } - struct PayloadHeader { + nonisolated struct PayloadHeader: Sendable { // 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 id: Int64 { - get {return _id ?? 0} + get {_id ?? 0} set {_id = newValue} } /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} + var hasID: Bool {self._id != nil} /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} var type: Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader.PayloadType { - get {return _type ?? .unknownPayloadType} + get {_type ?? .unknownPayloadType} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} var totalSize: Int64 { - get {return _totalSize ?? 0} + get {_totalSize ?? 0} set {_totalSize = newValue} } /// Returns true if `totalSize` has been explicitly set. - var hasTotalSize: Bool {return self._totalSize != nil} + var hasTotalSize: Bool {self._totalSize != nil} /// Clears the value of `totalSize`. Subsequent reads from it will return its default value. mutating func clearTotalSize() {self._totalSize = nil} var isSensitive: Bool { - get {return _isSensitive ?? false} + get {_isSensitive ?? false} set {_isSensitive = newValue} } /// Returns true if `isSensitive` has been explicitly set. - var hasIsSensitive: Bool {return self._isSensitive != nil} + var hasIsSensitive: Bool {self._isSensitive != nil} /// Clears the value of `isSensitive`. Subsequent reads from it will return its default value. mutating func clearIsSensitive() {self._isSensitive = nil} var fileName: String { - get {return _fileName ?? String()} + get {_fileName ?? String()} set {_fileName = newValue} } /// Returns true if `fileName` has been explicitly set. - var hasFileName: Bool {return self._fileName != nil} + var hasFileName: Bool {self._fileName != nil} /// Clears the value of `fileName`. Subsequent reads from it will return its default value. mutating func clearFileName() {self._fileName = nil} var parentFolder: String { - get {return _parentFolder ?? String()} + get {_parentFolder ?? String()} set {_parentFolder = newValue} } /// Returns true if `parentFolder` has been explicitly set. - var hasParentFolder: Bool {return self._parentFolder != nil} + var hasParentFolder: Bool {self._parentFolder != nil} /// Clears the value of `parentFolder`. Subsequent reads from it will return its default value. mutating func clearParentFolder() {self._parentFolder = nil} /// Time since the epoch in milliseconds. var lastModifiedTimestampMillis: Int64 { - get {return _lastModifiedTimestampMillis ?? 0} + get {_lastModifiedTimestampMillis ?? 0} set {_lastModifiedTimestampMillis = newValue} } /// Returns true if `lastModifiedTimestampMillis` has been explicitly set. - var hasLastModifiedTimestampMillis: Bool {return self._lastModifiedTimestampMillis != nil} + var hasLastModifiedTimestampMillis: Bool {self._lastModifiedTimestampMillis != nil} /// Clears the value of `lastModifiedTimestampMillis`. Subsequent reads from it will return its default value. mutating func clearLastModifiedTimestampMillis() {self._lastModifiedTimestampMillis = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum PayloadType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownPayloadType // = 0 - case bytes // = 1 - case file // = 2 - case stream // = 3 + enum PayloadType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownPayloadType = 0 + case bytes = 1 + case file = 2 + case stream = 3 init() { self = .unknownPayloadType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownPayloadType - case 1: self = .bytes - case 2: self = .file - case 3: self = .stream - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownPayloadType: return 0 - case .bytes: return 1 - case .file: return 2 - case .stream: return 3 - } - } - } init() {} @@ -963,70 +729,56 @@ struct Location_Nearby_Connections_PayloadTransferFrame { } /// Accompanies DATA packets. - struct PayloadChunk { + nonisolated struct PayloadChunk: Sendable { // 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 flags: Int32 { - get {return _flags ?? 0} + get {_flags ?? 0} set {_flags = newValue} } /// Returns true if `flags` has been explicitly set. - var hasFlags: Bool {return self._flags != nil} + var hasFlags: Bool {self._flags != nil} /// Clears the value of `flags`. Subsequent reads from it will return its default value. mutating func clearFlags() {self._flags = nil} var offset: Int64 { - get {return _offset ?? 0} + get {_offset ?? 0} set {_offset = newValue} } /// Returns true if `offset` has been explicitly set. - var hasOffset: Bool {return self._offset != nil} + var hasOffset: Bool {self._offset != nil} /// Clears the value of `offset`. Subsequent reads from it will return its default value. mutating func clearOffset() {self._offset = nil} var body: Data { - get {return _body ?? Data()} + get {_body ?? Data()} set {_body = newValue} } /// Returns true if `body` has been explicitly set. - var hasBody: Bool {return self._body != nil} + var hasBody: Bool {self._body != nil} /// Clears the value of `body`. Subsequent reads from it will return its default value. mutating func clearBody() {self._body = nil} var index: Int32 { - get {return _index ?? 0} + get {_index ?? 0} set {_index = newValue} } /// Returns true if `index` has been explicitly set. - var hasIndex: Bool {return self._index != nil} + var hasIndex: Bool {self._index != nil} /// Clears the value of `index`. Subsequent reads from it will return its default value. mutating func clearIndex() {self._index = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum Flags: SwiftProtobuf.Enum { - typealias RawValue = Int - case lastChunk // = 1 + enum Flags: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case lastChunk = 1 init() { self = .lastChunk } - init?(rawValue: Int) { - switch rawValue { - case 1: self = .lastChunk - default: return nil - } - } - - var rawValue: Int { - switch self { - case .lastChunk: return 1 - } - } - } init() {} @@ -1038,63 +790,45 @@ struct Location_Nearby_Connections_PayloadTransferFrame { } /// Accompanies CONTROL packets. - struct ControlMessage { + nonisolated struct ControlMessage: Sendable { // 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 event: Location_Nearby_Connections_PayloadTransferFrame.ControlMessage.EventType { - get {return _event ?? .unknownEventType} + get {_event ?? .unknownEventType} set {_event = newValue} } /// Returns true if `event` has been explicitly set. - var hasEvent: Bool {return self._event != nil} + var hasEvent: Bool {self._event != nil} /// Clears the value of `event`. Subsequent reads from it will return its default value. mutating func clearEvent() {self._event = nil} var offset: Int64 { - get {return _offset ?? 0} + get {_offset ?? 0} set {_offset = newValue} } /// Returns true if `offset` has been explicitly set. - var hasOffset: Bool {return self._offset != nil} + var hasOffset: Bool {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 EventType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownEventType // = 0 - case payloadError // = 1 - case payloadCanceled // = 2 + enum EventType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownEventType = 0 + case payloadError = 1 + case payloadCanceled = 2 /// Use PacketType.PAYLOAD_ACK instead - case payloadReceivedAck // = 3 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case payloadReceivedAck = 3 init() { self = .unknownEventType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownEventType - case 1: self = .payloadError - case 2: self = .payloadCanceled - case 3: self = .payloadReceivedAck - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownEventType: return 0 - case .payloadError: return 1 - case .payloadCanceled: return 2 - case .payloadReceivedAck: return 3 - } - } - } init() {} @@ -1111,347 +845,263 @@ struct Location_Nearby_Connections_PayloadTransferFrame { fileprivate var _controlMessage: Location_Nearby_Connections_PayloadTransferFrame.ControlMessage? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_PayloadTransferFrame.PacketType: CaseIterable { - // Support synthesized by the compiler. -} - -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader.PayloadType: CaseIterable { - // Support synthesized by the compiler. -} - -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk.Flags: CaseIterable { - // Support synthesized by the compiler. -} - -extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage.EventType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { +nonisolated struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: Sendable { // 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 eventType: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.EventType { - get {return _eventType ?? .unknownEventType} + get {_eventType ?? .unknownEventType} set {_eventType = newValue} } /// Returns true if `eventType` has been explicitly set. - var hasEventType: Bool {return self._eventType != nil} + var hasEventType: Bool {self._eventType != nil} /// Clears the value of `eventType`. Subsequent reads from it will return its default value. mutating func clearEventType() {self._eventType = nil} /// Exactly one of the following fields will be set. var upgradePathInfo: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo { - get {return _upgradePathInfo ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo()} + get {_upgradePathInfo ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo()} set {_upgradePathInfo = newValue} } /// Returns true if `upgradePathInfo` has been explicitly set. - var hasUpgradePathInfo: Bool {return self._upgradePathInfo != nil} + var hasUpgradePathInfo: Bool {self._upgradePathInfo != nil} /// Clears the value of `upgradePathInfo`. Subsequent reads from it will return its default value. mutating func clearUpgradePathInfo() {self._upgradePathInfo = nil} var clientIntroduction: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction { - get {return _clientIntroduction ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction()} + get {_clientIntroduction ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction()} set {_clientIntroduction = newValue} } /// Returns true if `clientIntroduction` has been explicitly set. - var hasClientIntroduction: Bool {return self._clientIntroduction != nil} + var hasClientIntroduction: Bool {self._clientIntroduction != nil} /// Clears the value of `clientIntroduction`. Subsequent reads from it will return its default value. mutating func clearClientIntroduction() {self._clientIntroduction = nil} var clientIntroductionAck: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck { - get {return _clientIntroductionAck ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck()} + get {_clientIntroductionAck ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck()} set {_clientIntroductionAck = newValue} } /// Returns true if `clientIntroductionAck` has been explicitly set. - var hasClientIntroductionAck: Bool {return self._clientIntroductionAck != nil} + var hasClientIntroductionAck: Bool {self._clientIntroductionAck != nil} /// Clears the value of `clientIntroductionAck`. Subsequent reads from it will return its default value. mutating func clearClientIntroductionAck() {self._clientIntroductionAck = nil} var safeToClosePriorChannel: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel { - get {return _safeToClosePriorChannel ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel()} + get {_safeToClosePriorChannel ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel()} set {_safeToClosePriorChannel = newValue} } /// Returns true if `safeToClosePriorChannel` has been explicitly set. - var hasSafeToClosePriorChannel: Bool {return self._safeToClosePriorChannel != nil} + var hasSafeToClosePriorChannel: Bool {self._safeToClosePriorChannel != nil} /// Clears the value of `safeToClosePriorChannel`. Subsequent reads from it will return its default value. mutating func clearSafeToClosePriorChannel() {self._safeToClosePriorChannel = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum EventType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownEventType // = 0 - case upgradePathAvailable // = 1 - case lastWriteToPriorChannel // = 2 - case safeToClosePriorChannel // = 3 - case clientIntroduction // = 4 - case upgradeFailure // = 5 - case clientIntroductionAck // = 6 + enum EventType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownEventType = 0 + case upgradePathAvailable = 1 + case lastWriteToPriorChannel = 2 + case safeToClosePriorChannel = 3 + case clientIntroduction = 4 + case upgradeFailure = 5 + case clientIntroductionAck = 6 /// The event type that requires the remote device to send the available /// upgrade path. - case upgradePathRequest // = 7 + case upgradePathRequest = 7 init() { self = .unknownEventType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownEventType - case 1: self = .upgradePathAvailable - case 2: self = .lastWriteToPriorChannel - case 3: self = .safeToClosePriorChannel - case 4: self = .clientIntroduction - case 5: self = .upgradeFailure - case 6: self = .clientIntroductionAck - case 7: self = .upgradePathRequest - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownEventType: return 0 - case .upgradePathAvailable: return 1 - case .lastWriteToPriorChannel: return 2 - case .safeToClosePriorChannel: return 3 - case .clientIntroduction: return 4 - case .upgradeFailure: return 5 - case .clientIntroductionAck: return 6 - case .upgradePathRequest: return 7 - } - } - } /// Accompanies UPGRADE_PATH_AVAILABLE and UPGRADE_FAILURE events. - struct UpgradePathInfo { + nonisolated struct UpgradePathInfo: @unchecked Sendable { // 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 medium: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium { - get {return _storage._medium ?? .unknownMedium} + get {_storage._medium ?? .unknownMedium} set {_uniqueStorage()._medium = newValue} } /// Returns true if `medium` has been explicitly set. - var hasMedium: Bool {return _storage._medium != nil} + var hasMedium: Bool {_storage._medium != nil} /// Clears the value of `medium`. Subsequent reads from it will return its default value. mutating func clearMedium() {_uniqueStorage()._medium = nil} /// Exactly one of the following fields will be set. var wifiHotspotCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiHotspotCredentials { - get {return _storage._wifiHotspotCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiHotspotCredentials()} + get {_storage._wifiHotspotCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiHotspotCredentials()} set {_uniqueStorage()._wifiHotspotCredentials = newValue} } /// Returns true if `wifiHotspotCredentials` has been explicitly set. - var hasWifiHotspotCredentials: Bool {return _storage._wifiHotspotCredentials != nil} + var hasWifiHotspotCredentials: Bool {_storage._wifiHotspotCredentials != nil} /// Clears the value of `wifiHotspotCredentials`. Subsequent reads from it will return its default value. mutating func clearWifiHotspotCredentials() {_uniqueStorage()._wifiHotspotCredentials = nil} var wifiLanSocket: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiLanSocket { - get {return _storage._wifiLanSocket ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiLanSocket()} + get {_storage._wifiLanSocket ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiLanSocket()} set {_uniqueStorage()._wifiLanSocket = newValue} } /// Returns true if `wifiLanSocket` has been explicitly set. - var hasWifiLanSocket: Bool {return _storage._wifiLanSocket != nil} + var hasWifiLanSocket: Bool {_storage._wifiLanSocket != nil} /// Clears the value of `wifiLanSocket`. Subsequent reads from it will return its default value. mutating func clearWifiLanSocket() {_uniqueStorage()._wifiLanSocket = nil} var bluetoothCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.BluetoothCredentials { - get {return _storage._bluetoothCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.BluetoothCredentials()} + get {_storage._bluetoothCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.BluetoothCredentials()} set {_uniqueStorage()._bluetoothCredentials = newValue} } /// Returns true if `bluetoothCredentials` has been explicitly set. - var hasBluetoothCredentials: Bool {return _storage._bluetoothCredentials != nil} + var hasBluetoothCredentials: Bool {_storage._bluetoothCredentials != nil} /// Clears the value of `bluetoothCredentials`. Subsequent reads from it will return its default value. mutating func clearBluetoothCredentials() {_uniqueStorage()._bluetoothCredentials = nil} var wifiAwareCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials { - get {return _storage._wifiAwareCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials()} + get {_storage._wifiAwareCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials()} set {_uniqueStorage()._wifiAwareCredentials = newValue} } /// Returns true if `wifiAwareCredentials` has been explicitly set. - var hasWifiAwareCredentials: Bool {return _storage._wifiAwareCredentials != nil} + var hasWifiAwareCredentials: Bool {_storage._wifiAwareCredentials != nil} /// Clears the value of `wifiAwareCredentials`. Subsequent reads from it will return its default value. mutating func clearWifiAwareCredentials() {_uniqueStorage()._wifiAwareCredentials = nil} var wifiDirectCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials { - get {return _storage._wifiDirectCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials()} + get {_storage._wifiDirectCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials()} set {_uniqueStorage()._wifiDirectCredentials = newValue} } /// Returns true if `wifiDirectCredentials` has been explicitly set. - var hasWifiDirectCredentials: Bool {return _storage._wifiDirectCredentials != nil} + var hasWifiDirectCredentials: Bool {_storage._wifiDirectCredentials != nil} /// Clears the value of `wifiDirectCredentials`. Subsequent reads from it will return its default value. mutating func clearWifiDirectCredentials() {_uniqueStorage()._wifiDirectCredentials = nil} var webRtcCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials { - get {return _storage._webRtcCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials()} + get {_storage._webRtcCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials()} set {_uniqueStorage()._webRtcCredentials = newValue} } /// Returns true if `webRtcCredentials` has been explicitly set. - var hasWebRtcCredentials: Bool {return _storage._webRtcCredentials != nil} + var hasWebRtcCredentials: Bool {_storage._webRtcCredentials != nil} /// Clears the value of `webRtcCredentials`. Subsequent reads from it will return its default value. mutating func clearWebRtcCredentials() {_uniqueStorage()._webRtcCredentials = nil} var awdlCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials { - get {return _storage._awdlCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials()} + get {_storage._awdlCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials()} set {_uniqueStorage()._awdlCredentials = newValue} } /// Returns true if `awdlCredentials` has been explicitly set. - var hasAwdlCredentials: Bool {return _storage._awdlCredentials != nil} + var hasAwdlCredentials: Bool {_storage._awdlCredentials != nil} /// Clears the value of `awdlCredentials`. Subsequent reads from it will return its default value. mutating func clearAwdlCredentials() {_uniqueStorage()._awdlCredentials = nil} /// Disable Encryption for this upgrade medium to improve throughput. var supportsDisablingEncryption: Bool { - get {return _storage._supportsDisablingEncryption ?? false} + get {_storage._supportsDisablingEncryption ?? false} set {_uniqueStorage()._supportsDisablingEncryption = newValue} } /// Returns true if `supportsDisablingEncryption` has been explicitly set. - var hasSupportsDisablingEncryption: Bool {return _storage._supportsDisablingEncryption != nil} + var hasSupportsDisablingEncryption: Bool {_storage._supportsDisablingEncryption != nil} /// Clears the value of `supportsDisablingEncryption`. Subsequent reads from it will return its default value. mutating func clearSupportsDisablingEncryption() {_uniqueStorage()._supportsDisablingEncryption = nil} /// An ack will be sent after the CLIENT_INTRODUCTION frame. var supportsClientIntroductionAck: Bool { - get {return _storage._supportsClientIntroductionAck ?? false} + get {_storage._supportsClientIntroductionAck ?? false} set {_uniqueStorage()._supportsClientIntroductionAck = newValue} } /// Returns true if `supportsClientIntroductionAck` has been explicitly set. - var hasSupportsClientIntroductionAck: Bool {return _storage._supportsClientIntroductionAck != nil} + var hasSupportsClientIntroductionAck: Bool {_storage._supportsClientIntroductionAck != nil} /// Clears the value of `supportsClientIntroductionAck`. Subsequent reads from it will return its default value. mutating func clearSupportsClientIntroductionAck() {_uniqueStorage()._supportsClientIntroductionAck = nil} var upgradePathRequest: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest { - get {return _storage._upgradePathRequest ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest()} + get {_storage._upgradePathRequest ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest()} set {_uniqueStorage()._upgradePathRequest = newValue} } /// Returns true if `upgradePathRequest` has been explicitly set. - var hasUpgradePathRequest: Bool {return _storage._upgradePathRequest != nil} + var hasUpgradePathRequest: Bool {_storage._upgradePathRequest != nil} /// Clears the value of `upgradePathRequest`. Subsequent reads from it will return its default value. mutating func clearUpgradePathRequest() {_uniqueStorage()._upgradePathRequest = nil} var unknownFields = SwiftProtobuf.UnknownStorage() /// Should always match cs/symbol:location.nearby.proto.connections.Medium - enum Medium: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownMedium // = 0 - case mdns // = 1 - case bluetooth // = 2 - case wifiHotspot // = 3 - case ble // = 4 - case wifiLan // = 5 - case wifiAware // = 6 - case nfc // = 7 - case wifiDirect // = 8 - case webRtc // = 9 + enum Medium: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownMedium = 0 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case mdns = 1 + case bluetooth = 2 + case wifiHotspot = 3 + case ble = 4 + case wifiLan = 5 + case wifiAware = 6 + case nfc = 7 + case wifiDirect = 8 + case webRtc = 9 /// 10 is reserved. - case usb // = 11 - case webRtcNonCellular // = 12 - case awdl // = 13 + case usb = 11 + case webRtcNonCellular = 12 + case awdl = 13 init() { self = .unknownMedium } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownMedium - case 1: self = .mdns - case 2: self = .bluetooth - case 3: self = .wifiHotspot - case 4: self = .ble - case 5: self = .wifiLan - case 6: self = .wifiAware - case 7: self = .nfc - case 8: self = .wifiDirect - case 9: self = .webRtc - case 11: self = .usb - case 12: self = .webRtcNonCellular - case 13: self = .awdl - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownMedium: return 0 - case .mdns: return 1 - case .bluetooth: return 2 - case .wifiHotspot: return 3 - case .ble: return 4 - case .wifiLan: return 5 - case .wifiAware: return 6 - case .nfc: return 7 - case .wifiDirect: return 8 - case .webRtc: return 9 - case .usb: return 11 - case .webRtcNonCellular: return 12 - case .awdl: return 13 - } - } - } /// Accompanies Medium.WIFI_HOTSPOT. - struct WifiHotspotCredentials { + struct WifiHotspotCredentials: Sendable { // 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 ssid: String { - get {return _ssid ?? String()} + get {_ssid ?? String()} set {_ssid = newValue} } /// Returns true if `ssid` has been explicitly set. - var hasSsid: Bool {return self._ssid != nil} + var hasSsid: Bool {self._ssid != nil} /// Clears the value of `ssid`. Subsequent reads from it will return its default value. mutating func clearSsid() {self._ssid = nil} var password: String { - get {return _password ?? String()} + get {_password ?? String()} set {_password = newValue} } /// Returns true if `password` has been explicitly set. - var hasPassword: Bool {return self._password != nil} + var hasPassword: Bool {self._password != nil} /// Clears the value of `password`. Subsequent reads from it will return its default value. mutating func clearPassword() {self._password = nil} var port: Int32 { - get {return _port ?? 0} + get {_port ?? 0} set {_port = newValue} } /// Returns true if `port` has been explicitly set. - var hasPort: Bool {return self._port != nil} + var hasPort: Bool {self._port != nil} /// Clears the value of `port`. Subsequent reads from it will return its default value. mutating func clearPort() {self._port = nil} var gateway: String { - get {return _gateway ?? "0.0.0.0"} + get {_gateway ?? "0.0.0.0"} set {_gateway = newValue} } /// Returns true if `gateway` has been explicitly set. - var hasGateway: Bool {return self._gateway != nil} + var hasGateway: Bool {self._gateway != nil} /// Clears the value of `gateway`. Subsequent reads from it will return its default value. mutating func clearGateway() {self._gateway = nil} /// This field can be a band or frequency var frequency: Int32 { - get {return _frequency ?? -1} + get {_frequency ?? -1} set {_frequency = newValue} } /// Returns true if `frequency` has been explicitly set. - var hasFrequency: Bool {return self._frequency != nil} + var hasFrequency: Bool {self._frequency != nil} /// Clears the value of `frequency`. Subsequent reads from it will return its default value. mutating func clearFrequency() {self._frequency = nil} @@ -1467,26 +1117,26 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies Medium.WIFI_LAN. - struct WifiLanSocket { + struct WifiLanSocket: Sendable { // 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 ipAddress: Data { - get {return _ipAddress ?? Data()} + get {_ipAddress ?? Data()} set {_ipAddress = newValue} } /// Returns true if `ipAddress` has been explicitly set. - var hasIpAddress: Bool {return self._ipAddress != nil} + var hasIpAddress: Bool {self._ipAddress != nil} /// Clears the value of `ipAddress`. Subsequent reads from it will return its default value. mutating func clearIpAddress() {self._ipAddress = nil} var wifiPort: Int32 { - get {return _wifiPort ?? 0} + get {_wifiPort ?? 0} set {_wifiPort = newValue} } /// Returns true if `wifiPort` has been explicitly set. - var hasWifiPort: Bool {return self._wifiPort != nil} + var hasWifiPort: Bool {self._wifiPort != nil} /// Clears the value of `wifiPort`. Subsequent reads from it will return its default value. mutating func clearWifiPort() {self._wifiPort = nil} @@ -1499,26 +1149,26 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies Medium.BLUETOOTH. - struct BluetoothCredentials { + struct BluetoothCredentials: Sendable { // 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 serviceName: String { - get {return _serviceName ?? String()} + get {_serviceName ?? String()} set {_serviceName = newValue} } /// Returns true if `serviceName` has been explicitly set. - var hasServiceName: Bool {return self._serviceName != nil} + var hasServiceName: Bool {self._serviceName != nil} /// Clears the value of `serviceName`. Subsequent reads from it will return its default value. mutating func clearServiceName() {self._serviceName = nil} var macAddress: String { - get {return _macAddress ?? String()} + get {_macAddress ?? String()} set {_macAddress = newValue} } /// Returns true if `macAddress` has been explicitly set. - var hasMacAddress: Bool {return self._macAddress != nil} + var hasMacAddress: Bool {self._macAddress != nil} /// Clears the value of `macAddress`. Subsequent reads from it will return its default value. mutating func clearMacAddress() {self._macAddress = nil} @@ -1531,35 +1181,35 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies Medium.WIFI_AWARE. - struct WifiAwareCredentials { + struct WifiAwareCredentials: Sendable { // 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 serviceID: String { - get {return _serviceID ?? String()} + get {_serviceID ?? String()} set {_serviceID = newValue} } /// Returns true if `serviceID` has been explicitly set. - var hasServiceID: Bool {return self._serviceID != nil} + var hasServiceID: Bool {self._serviceID != nil} /// Clears the value of `serviceID`. Subsequent reads from it will return its default value. mutating func clearServiceID() {self._serviceID = nil} var serviceInfo: Data { - get {return _serviceInfo ?? Data()} + get {_serviceInfo ?? Data()} set {_serviceInfo = newValue} } /// Returns true if `serviceInfo` has been explicitly set. - var hasServiceInfo: Bool {return self._serviceInfo != nil} + var hasServiceInfo: Bool {self._serviceInfo != nil} /// Clears the value of `serviceInfo`. Subsequent reads from it will return its default value. mutating func clearServiceInfo() {self._serviceInfo = nil} var password: String { - get {return _password ?? String()} + get {_password ?? String()} set {_password = newValue} } /// Returns true if `password` has been explicitly set. - var hasPassword: Bool {return self._password != nil} + var hasPassword: Bool {self._password != nil} /// Clears the value of `password`. Subsequent reads from it will return its default value. mutating func clearPassword() {self._password = nil} @@ -1573,53 +1223,53 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies Medium.WIFI_DIRECT. - struct WifiDirectCredentials { + struct WifiDirectCredentials: Sendable { // 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 ssid: String { - get {return _ssid ?? String()} + get {_ssid ?? String()} set {_ssid = newValue} } /// Returns true if `ssid` has been explicitly set. - var hasSsid: Bool {return self._ssid != nil} + var hasSsid: Bool {self._ssid != nil} /// Clears the value of `ssid`. Subsequent reads from it will return its default value. mutating func clearSsid() {self._ssid = nil} var password: String { - get {return _password ?? String()} + get {_password ?? String()} set {_password = newValue} } /// Returns true if `password` has been explicitly set. - var hasPassword: Bool {return self._password != nil} + var hasPassword: Bool {self._password != nil} /// Clears the value of `password`. Subsequent reads from it will return its default value. mutating func clearPassword() {self._password = nil} var port: Int32 { - get {return _port ?? 0} + get {_port ?? 0} set {_port = newValue} } /// Returns true if `port` has been explicitly set. - var hasPort: Bool {return self._port != nil} + var hasPort: Bool {self._port != nil} /// Clears the value of `port`. Subsequent reads from it will return its default value. mutating func clearPort() {self._port = nil} var frequency: Int32 { - get {return _frequency ?? 0} + get {_frequency ?? 0} set {_frequency = newValue} } /// Returns true if `frequency` has been explicitly set. - var hasFrequency: Bool {return self._frequency != nil} + var hasFrequency: Bool {self._frequency != nil} /// Clears the value of `frequency`. Subsequent reads from it will return its default value. mutating func clearFrequency() {self._frequency = nil} var gateway: String { - get {return _gateway ?? "0.0.0.0"} + get {_gateway ?? "0.0.0.0"} set {_gateway = newValue} } /// Returns true if `gateway` has been explicitly set. - var hasGateway: Bool {return self._gateway != nil} + var hasGateway: Bool {self._gateway != nil} /// Clears the value of `gateway`. Subsequent reads from it will return its default value. mutating func clearGateway() {self._gateway = nil} @@ -1627,11 +1277,11 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// The GO should listen on both IPv4 and IPv6 addresses. /// https://en.wikipedia.org/wiki/Link-local_address#IPv6 var ipV6Address: Data { - get {return _ipV6Address ?? Data()} + get {_ipV6Address ?? Data()} set {_ipV6Address = newValue} } /// Returns true if `ipV6Address` has been explicitly set. - var hasIpV6Address: Bool {return self._ipV6Address != nil} + var hasIpV6Address: Bool {self._ipV6Address != nil} /// Clears the value of `ipV6Address`. Subsequent reads from it will return its default value. mutating func clearIpV6Address() {self._ipV6Address = nil} @@ -1648,26 +1298,26 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies Medium.WEB_RTC - struct WebRtcCredentials { + struct WebRtcCredentials: Sendable { // 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 peerID: String { - get {return _peerID ?? String()} + get {_peerID ?? String()} set {_peerID = newValue} } /// Returns true if `peerID` has been explicitly set. - var hasPeerID: Bool {return self._peerID != nil} + var hasPeerID: Bool {self._peerID != nil} /// Clears the value of `peerID`. Subsequent reads from it will return its default value. mutating func clearPeerID() {self._peerID = nil} var locationHint: Location_Nearby_Connections_LocationHint { - get {return _locationHint ?? Location_Nearby_Connections_LocationHint()} + get {_locationHint ?? Location_Nearby_Connections_LocationHint()} set {_locationHint = newValue} } /// Returns true if `locationHint` has been explicitly set. - var hasLocationHint: Bool {return self._locationHint != nil} + var hasLocationHint: Bool {self._locationHint != nil} /// Clears the value of `locationHint`. Subsequent reads from it will return its default value. mutating func clearLocationHint() {self._locationHint = nil} @@ -1680,35 +1330,35 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies Medium.AWDL. - struct AwdlCredentials { + struct AwdlCredentials: Sendable { // 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 serviceName: String { - get {return _serviceName ?? String()} + get {_serviceName ?? String()} set {_serviceName = newValue} } /// Returns true if `serviceName` has been explicitly set. - var hasServiceName: Bool {return self._serviceName != nil} + var hasServiceName: Bool {self._serviceName != nil} /// Clears the value of `serviceName`. Subsequent reads from it will return its default value. mutating func clearServiceName() {self._serviceName = nil} var serviceType: String { - get {return _serviceType ?? String()} + get {_serviceType ?? String()} set {_serviceType = newValue} } /// Returns true if `serviceType` has been explicitly set. - var hasServiceType: Bool {return self._serviceType != nil} + var hasServiceType: Bool {self._serviceType != nil} /// Clears the value of `serviceType`. Subsequent reads from it will return its default value. mutating func clearServiceType() {self._serviceType = nil} var password: String { - get {return _password ?? String()} + get {_password ?? String()} set {_password = newValue} } /// Returns true if `password` has been explicitly set. - var hasPassword: Bool {return self._password != nil} + var hasPassword: Bool {self._password != nil} /// Clears the value of `password`. Subsequent reads from it will return its default value. mutating func clearPassword() {self._password = nil} @@ -1721,7 +1371,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { fileprivate var _password: String? = nil } - struct UpgradePathRequest { + struct UpgradePathRequest: Sendable { // 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. @@ -1730,11 +1380,11 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { var mediums: [Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium] = [] var mediumMetaData: Location_Nearby_Connections_MediumMetadata { - get {return _mediumMetaData ?? Location_Nearby_Connections_MediumMetadata()} + get {_mediumMetaData ?? Location_Nearby_Connections_MediumMetadata()} set {_mediumMetaData = newValue} } /// Returns true if `mediumMetaData` has been explicitly set. - var hasMediumMetaData: Bool {return self._mediumMetaData != nil} + var hasMediumMetaData: Bool {self._mediumMetaData != nil} /// Clears the value of `mediumMetaData`. Subsequent reads from it will return its default value. mutating func clearMediumMetaData() {self._mediumMetaData = nil} @@ -1751,17 +1401,17 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies SAFE_TO_CLOSE_PRIOR_CHANNEL events. - struct SafeToClosePriorChannel { + nonisolated struct SafeToClosePriorChannel: Sendable { // 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 staFrequency: Int32 { - get {return _staFrequency ?? 0} + get {_staFrequency ?? 0} set {_staFrequency = newValue} } /// Returns true if `staFrequency` has been explicitly set. - var hasStaFrequency: Bool {return self._staFrequency != nil} + var hasStaFrequency: Bool {self._staFrequency != nil} /// Clears the value of `staFrequency`. Subsequent reads from it will return its default value. mutating func clearStaFrequency() {self._staFrequency = nil} @@ -1773,35 +1423,35 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies CLIENT_INTRODUCTION events. - struct ClientIntroduction { + nonisolated struct ClientIntroduction: Sendable { // 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 endpointID: String { - get {return _endpointID ?? String()} + get {_endpointID ?? String()} set {_endpointID = newValue} } /// Returns true if `endpointID` has been explicitly set. - var hasEndpointID: Bool {return self._endpointID != nil} + var hasEndpointID: Bool {self._endpointID != nil} /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. mutating func clearEndpointID() {self._endpointID = nil} var supportsDisablingEncryption: Bool { - get {return _supportsDisablingEncryption ?? false} + get {_supportsDisablingEncryption ?? false} set {_supportsDisablingEncryption = newValue} } /// Returns true if `supportsDisablingEncryption` has been explicitly set. - var hasSupportsDisablingEncryption: Bool {return self._supportsDisablingEncryption != nil} + var hasSupportsDisablingEncryption: Bool {self._supportsDisablingEncryption != nil} /// Clears the value of `supportsDisablingEncryption`. Subsequent reads from it will return its default value. mutating func clearSupportsDisablingEncryption() {self._supportsDisablingEncryption = nil} var lastEndpointID: String { - get {return _lastEndpointID ?? String()} + get {_lastEndpointID ?? String()} set {_lastEndpointID = newValue} } /// Returns true if `lastEndpointID` has been explicitly set. - var hasLastEndpointID: Bool {return self._lastEndpointID != nil} + var hasLastEndpointID: Bool {self._lastEndpointID != nil} /// Clears the value of `lastEndpointID`. Subsequent reads from it will return its default value. mutating func clearLastEndpointID() {self._lastEndpointID = nil} @@ -1815,7 +1465,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { } /// Accompanies CLIENT_INTRODUCTION_ACK events. - struct ClientIntroductionAck { + nonisolated struct ClientIntroductionAck: Sendable { // 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. @@ -1834,19 +1484,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { fileprivate var _safeToClosePriorChannel: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.EventType: CaseIterable { - // Support synthesized by the compiler. -} - -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_BandwidthUpgradeRetryFrame { +nonisolated struct Location_Nearby_Connections_BandwidthUpgradeRetryFrame: Sendable { // 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. @@ -1858,11 +1496,11 @@ struct Location_Nearby_Connections_BandwidthUpgradeRetryFrame { /// If true, expect the remote endpoint to send back the latest /// supported_medium. var isRequest: Bool { - get {return _isRequest ?? false} + get {_isRequest ?? false} set {_isRequest = newValue} } /// Returns true if `isRequest` has been explicitly set. - var hasIsRequest: Bool {return self._isRequest != nil} + var hasIsRequest: Bool {self._isRequest != nil} /// Clears the value of `isRequest`. Subsequent reads from it will return its default value. mutating func clearIsRequest() {self._isRequest = nil} @@ -1870,65 +1508,27 @@ struct Location_Nearby_Connections_BandwidthUpgradeRetryFrame { /// Should always match cs/symbol:location.nearby.proto.connections.Medium /// LINT.IfChange - enum Medium: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownMedium // = 0 + enum Medium: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownMedium = 0 /// 1 is reserved. - case bluetooth // = 2 - case wifiHotspot // = 3 - case ble // = 4 - case wifiLan // = 5 - case wifiAware // = 6 - case nfc // = 7 - case wifiDirect // = 8 - case webRtc // = 9 - case bleL2Cap // = 10 - case usb // = 11 - case webRtcNonCellular // = 12 - case awdl // = 13 + case bluetooth = 2 + case wifiHotspot = 3 + case ble = 4 + case wifiLan = 5 + case wifiAware = 6 + case nfc = 7 + case wifiDirect = 8 + case webRtc = 9 + case bleL2Cap = 10 + case usb = 11 + case webRtcNonCellular = 12 + case awdl = 13 init() { self = .unknownMedium } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownMedium - case 2: self = .bluetooth - case 3: self = .wifiHotspot - case 4: self = .ble - case 5: self = .wifiLan - case 6: self = .wifiAware - case 7: self = .nfc - case 8: self = .wifiDirect - case 9: self = .webRtc - case 10: self = .bleL2Cap - case 11: self = .usb - case 12: self = .webRtcNonCellular - case 13: self = .awdl - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownMedium: return 0 - case .bluetooth: return 2 - case .wifiHotspot: return 3 - case .ble: return 4 - case .wifiLan: return 5 - case .wifiAware: return 6 - case .nfc: return 7 - case .wifiDirect: return 8 - case .webRtc: return 9 - case .bleL2Cap: return 10 - case .usb: return 11 - case .webRtcNonCellular: return 12 - case .awdl: return 13 - } - } - } init() {} @@ -1936,36 +1536,28 @@ struct Location_Nearby_Connections_BandwidthUpgradeRetryFrame { fileprivate var _isRequest: Bool? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_KeepAliveFrame { +nonisolated struct Location_Nearby_Connections_KeepAliveFrame: Sendable { // 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. /// And ack will be sent after receiving KEEP_ALIVE frame. var ack: Bool { - get {return _ack ?? false} + get {_ack ?? false} set {_ack = newValue} } /// Returns true if `ack` has been explicitly set. - var hasAck: Bool {return self._ack != nil} + var hasAck: Bool {self._ack != nil} /// Clears the value of `ack`. Subsequent reads from it will return its default value. mutating func clearAck() {self._ack = nil} /// The sequence number var seqNum: UInt32 { - get {return _seqNum ?? 0} + get {_seqNum ?? 0} set {_seqNum = newValue} } /// Returns true if `seqNum` has been explicitly set. - var hasSeqNum: Bool {return self._seqNum != nil} + var hasSeqNum: Bool {self._seqNum != nil} /// Clears the value of `seqNum`. Subsequent reads from it will return its default value. mutating func clearSeqNum() {self._seqNum = nil} @@ -1981,29 +1573,29 @@ struct Location_Nearby_Connections_KeepAliveFrame { /// Used in bandwidth upgrades to get around a race condition, but may be used /// in other situations to trigger a faster disconnection event than waiting for /// socket closed on the remote side. -struct Location_Nearby_Connections_DisconnectionFrame { +nonisolated struct Location_Nearby_Connections_DisconnectionFrame: Sendable { // 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. /// Apply safe-to-disconnect protocol if true. var requestSafeToDisconnect: Bool { - get {return _requestSafeToDisconnect ?? false} + get {_requestSafeToDisconnect ?? false} set {_requestSafeToDisconnect = newValue} } /// Returns true if `requestSafeToDisconnect` has been explicitly set. - var hasRequestSafeToDisconnect: Bool {return self._requestSafeToDisconnect != nil} + var hasRequestSafeToDisconnect: Bool {self._requestSafeToDisconnect != nil} /// Clears the value of `requestSafeToDisconnect`. Subsequent reads from it will return its default value. mutating func clearRequestSafeToDisconnect() {self._requestSafeToDisconnect = nil} /// Ack of receiving Disconnection frame will be sent to the sender /// frame. var ackSafeToDisconnect: Bool { - get {return _ackSafeToDisconnect ?? false} + get {_ackSafeToDisconnect ?? false} set {_ackSafeToDisconnect = newValue} } /// Returns true if `ackSafeToDisconnect` has been explicitly set. - var hasAckSafeToDisconnect: Bool {return self._ackSafeToDisconnect != nil} + var hasAckSafeToDisconnect: Bool {self._ackSafeToDisconnect != nil} /// Clears the value of `ackSafeToDisconnect`. Subsequent reads from it will return its default value. mutating func clearAckSafeToDisconnect() {self._ackSafeToDisconnect = nil} @@ -2016,7 +1608,7 @@ struct Location_Nearby_Connections_DisconnectionFrame { } /// A paired key encryption packet sent between devices, contains signed data. -struct Location_Nearby_Connections_PairedKeyEncryptionFrame { +nonisolated struct Location_Nearby_Connections_PairedKeyEncryptionFrame: Sendable { // 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. @@ -2024,11 +1616,11 @@ struct Location_Nearby_Connections_PairedKeyEncryptionFrame { /// The encrypted data (raw authentication token for the established /// connection) in byte array format. var signedData: Data { - get {return _signedData ?? Data()} + get {_signedData ?? Data()} set {_signedData = newValue} } /// Returns true if `signedData` has been explicitly set. - var hasSignedData: Bool {return self._signedData != nil} + var hasSignedData: Bool {self._signedData != nil} /// Clears the value of `signedData`. Subsequent reads from it will return its default value. mutating func clearSignedData() {self._signedData = nil} @@ -2041,7 +1633,7 @@ struct Location_Nearby_Connections_PairedKeyEncryptionFrame { /// Nearby Connections authentication frame, contains the bytes format of a /// DeviceProvider's authentication message. -struct Location_Nearby_Connections_AuthenticationMessageFrame { +nonisolated struct Location_Nearby_Connections_AuthenticationMessageFrame: Sendable { // 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. @@ -2049,11 +1641,11 @@ struct Location_Nearby_Connections_AuthenticationMessageFrame { /// An auth message generated by DeviceProvider. /// To be sent to the remote device for verification during connection setups. var authMessage: Data { - get {return _authMessage ?? Data()} + get {_authMessage ?? Data()} set {_authMessage = newValue} } /// Returns true if `authMessage` has been explicitly set. - var hasAuthMessage: Bool {return self._authMessage != nil} + var hasAuthMessage: Bool {self._authMessage != nil} /// Clears the value of `authMessage`. Subsequent reads from it will return its default value. mutating func clearAuthMessage() {self._authMessage = nil} @@ -2065,7 +1657,7 @@ struct Location_Nearby_Connections_AuthenticationMessageFrame { } /// Nearby Connections authentication result frame. -struct Location_Nearby_Connections_AuthenticationResultFrame { +nonisolated struct Location_Nearby_Connections_AuthenticationResultFrame: Sendable { // 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. @@ -2073,11 +1665,11 @@ struct Location_Nearby_Connections_AuthenticationResultFrame { /// The authentication result. Non null if this frame is used to exchange /// authentication result. var result: Int32 { - get {return _result ?? 0} + get {_result ?? 0} set {_result = newValue} } /// Returns true if `result` has been explicitly set. - var hasResult: Bool {return self._result != nil} + var hasResult: Bool {self._result != nil} /// Clears the value of `result`. Subsequent reads from it will return its default value. mutating func clearResult() {self._result = nil} @@ -2088,76 +1680,58 @@ struct Location_Nearby_Connections_AuthenticationResultFrame { fileprivate var _result: Int32? = nil } -struct Location_Nearby_Connections_AutoResumeFrame { +nonisolated struct Location_Nearby_Connections_AutoResumeFrame: Sendable { // 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 eventType: Location_Nearby_Connections_AutoResumeFrame.EventType { - get {return _eventType ?? .unknownAutoResumeEventType} + get {_eventType ?? .unknownAutoResumeEventType} set {_eventType = newValue} } /// Returns true if `eventType` has been explicitly set. - var hasEventType: Bool {return self._eventType != nil} + var hasEventType: Bool {self._eventType != nil} /// Clears the value of `eventType`. Subsequent reads from it will return its default value. mutating func clearEventType() {self._eventType = nil} var pendingPayloadID: Int64 { - get {return _pendingPayloadID ?? 0} + get {_pendingPayloadID ?? 0} set {_pendingPayloadID = newValue} } /// Returns true if `pendingPayloadID` has been explicitly set. - var hasPendingPayloadID: Bool {return self._pendingPayloadID != nil} + var hasPendingPayloadID: Bool {self._pendingPayloadID != nil} /// Clears the value of `pendingPayloadID`. Subsequent reads from it will return its default value. mutating func clearPendingPayloadID() {self._pendingPayloadID = nil} var nextPayloadChunkIndex: Int32 { - get {return _nextPayloadChunkIndex ?? 0} + get {_nextPayloadChunkIndex ?? 0} set {_nextPayloadChunkIndex = newValue} } /// Returns true if `nextPayloadChunkIndex` has been explicitly set. - var hasNextPayloadChunkIndex: Bool {return self._nextPayloadChunkIndex != nil} + var hasNextPayloadChunkIndex: Bool {self._nextPayloadChunkIndex != nil} /// Clears the value of `nextPayloadChunkIndex`. Subsequent reads from it will return its default value. mutating func clearNextPayloadChunkIndex() {self._nextPayloadChunkIndex = nil} var version: Int32 { - get {return _version ?? 0} + get {_version ?? 0} set {_version = newValue} } /// Returns true if `version` has been explicitly set. - var hasVersion: Bool {return self._version != nil} + var hasVersion: Bool {self._version != nil} /// Clears the value of `version`. Subsequent reads from it will return its default value. mutating func clearVersion() {self._version = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum EventType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownAutoResumeEventType // = 0 - case payloadResumeTransferStart // = 1 - case payloadResumeTransferAck // = 2 + enum EventType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownAutoResumeEventType = 0 + case payloadResumeTransferStart = 1 + case payloadResumeTransferAck = 2 init() { self = .unknownAutoResumeEventType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownAutoResumeEventType - case 1: self = .payloadResumeTransferStart - case 2: self = .payloadResumeTransferAck - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownAutoResumeEventType: return 0 - case .payloadResumeTransferStart: return 1 - case .payloadResumeTransferAck: return 2 - } - } - } init() {} @@ -2168,75 +1742,49 @@ struct Location_Nearby_Connections_AutoResumeFrame { fileprivate var _version: Int32? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_AutoResumeFrame.EventType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_AutoReconnectFrame { +nonisolated struct Location_Nearby_Connections_AutoReconnectFrame: Sendable { // 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 endpointID: String { - get {return _endpointID ?? String()} + get {_endpointID ?? String()} set {_endpointID = newValue} } /// Returns true if `endpointID` has been explicitly set. - var hasEndpointID: Bool {return self._endpointID != nil} + var hasEndpointID: Bool {self._endpointID != nil} /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. mutating func clearEndpointID() {self._endpointID = nil} var eventType: Location_Nearby_Connections_AutoReconnectFrame.EventType { - get {return _eventType ?? .unknownEventType} + get {_eventType ?? .unknownEventType} set {_eventType = newValue} } /// Returns true if `eventType` has been explicitly set. - var hasEventType: Bool {return self._eventType != nil} + var hasEventType: Bool {self._eventType != nil} /// Clears the value of `eventType`. Subsequent reads from it will return its default value. mutating func clearEventType() {self._eventType = nil} var lastEndpointID: String { - get {return _lastEndpointID ?? String()} + get {_lastEndpointID ?? String()} set {_lastEndpointID = newValue} } /// Returns true if `lastEndpointID` has been explicitly set. - var hasLastEndpointID: Bool {return self._lastEndpointID != nil} + var hasLastEndpointID: Bool {self._lastEndpointID != nil} /// Clears the value of `lastEndpointID`. Subsequent reads from it will return its default value. mutating func clearLastEndpointID() {self._lastEndpointID = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum EventType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownEventType // = 0 - case clientIntroduction // = 1 - case clientIntroductionAck // = 2 + enum EventType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownEventType = 0 + case clientIntroduction = 1 + case clientIntroductionAck = 2 init() { self = .unknownEventType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownEventType - case 1: self = .clientIntroduction - case 2: self = .clientIntroductionAck - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownEventType: return 0 - case .clientIntroduction: return 1 - case .clientIntroductionAck: return 2 - } - } - } init() {} @@ -2246,138 +1794,130 @@ struct Location_Nearby_Connections_AutoReconnectFrame { fileprivate var _lastEndpointID: String? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_AutoReconnectFrame.EventType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_MediumMetadata { +nonisolated struct Location_Nearby_Connections_MediumMetadata: @unchecked Sendable { // 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. /// True if local device supports 5GHz. var supports5Ghz: Bool { - get {return _storage._supports5Ghz ?? false} + get {_storage._supports5Ghz ?? false} set {_uniqueStorage()._supports5Ghz = newValue} } /// Returns true if `supports5Ghz` has been explicitly set. - var hasSupports5Ghz: Bool {return _storage._supports5Ghz != nil} + var hasSupports5Ghz: Bool {_storage._supports5Ghz != nil} /// Clears the value of `supports5Ghz`. Subsequent reads from it will return its default value. mutating func clearSupports5Ghz() {_uniqueStorage()._supports5Ghz = nil} /// WiFi LAN BSSID, in the form of a six-byte MAC address: XX:XX:XX:XX:XX:XX var bssid: String { - get {return _storage._bssid ?? String()} + get {_storage._bssid ?? String()} set {_uniqueStorage()._bssid = newValue} } /// Returns true if `bssid` has been explicitly set. - var hasBssid: Bool {return _storage._bssid != nil} + var hasBssid: Bool {_storage._bssid != nil} /// Clears the value of `bssid`. Subsequent reads from it will return its default value. mutating func clearBssid() {_uniqueStorage()._bssid = nil} /// IP address, in network byte order: the highest order byte of the address is /// in byte[0]. var ipAddress: Data { - get {return _storage._ipAddress ?? Data()} + get {_storage._ipAddress ?? Data()} set {_uniqueStorage()._ipAddress = newValue} } /// Returns true if `ipAddress` has been explicitly set. - var hasIpAddress: Bool {return _storage._ipAddress != nil} + var hasIpAddress: Bool {_storage._ipAddress != nil} /// Clears the value of `ipAddress`. Subsequent reads from it will return its default value. mutating func clearIpAddress() {_uniqueStorage()._ipAddress = nil} /// True if local device supports 6GHz. var supports6Ghz: Bool { - get {return _storage._supports6Ghz ?? false} + get {_storage._supports6Ghz ?? false} set {_uniqueStorage()._supports6Ghz = newValue} } /// Returns true if `supports6Ghz` has been explicitly set. - var hasSupports6Ghz: Bool {return _storage._supports6Ghz != nil} + var hasSupports6Ghz: Bool {_storage._supports6Ghz != nil} /// Clears the value of `supports6Ghz`. Subsequent reads from it will return its default value. mutating func clearSupports6Ghz() {_uniqueStorage()._supports6Ghz = nil} /// True if local device has mobile radio. var mobileRadio: Bool { - get {return _storage._mobileRadio ?? false} + get {_storage._mobileRadio ?? false} set {_uniqueStorage()._mobileRadio = newValue} } /// Returns true if `mobileRadio` has been explicitly set. - var hasMobileRadio: Bool {return _storage._mobileRadio != nil} + var hasMobileRadio: Bool {_storage._mobileRadio != nil} /// Clears the value of `mobileRadio`. Subsequent reads from it will return its default value. mutating func clearMobileRadio() {_uniqueStorage()._mobileRadio = nil} /// The frequency of the WiFi LAN AP(in MHz). Or -1 is not associated with an /// AP over WiFi, -2 represents the active network uses an Ethernet transport. var apFrequency: Int32 { - get {return _storage._apFrequency ?? -1} + get {_storage._apFrequency ?? -1} set {_uniqueStorage()._apFrequency = newValue} } /// Returns true if `apFrequency` has been explicitly set. - var hasApFrequency: Bool {return _storage._apFrequency != nil} + var hasApFrequency: Bool {_storage._apFrequency != nil} /// Clears the value of `apFrequency`. Subsequent reads from it will return its default value. mutating func clearApFrequency() {_uniqueStorage()._apFrequency = nil} /// Available channels on the local device. var availableChannels: Location_Nearby_Connections_AvailableChannels { - get {return _storage._availableChannels ?? Location_Nearby_Connections_AvailableChannels()} + get {_storage._availableChannels ?? Location_Nearby_Connections_AvailableChannels()} set {_uniqueStorage()._availableChannels = newValue} } /// Returns true if `availableChannels` has been explicitly set. - var hasAvailableChannels: Bool {return _storage._availableChannels != nil} + var hasAvailableChannels: Bool {_storage._availableChannels != nil} /// Clears the value of `availableChannels`. Subsequent reads from it will return its default value. mutating func clearAvailableChannels() {_uniqueStorage()._availableChannels = nil} /// Usable WiFi Direct client channels on the local device. var wifiDirectCliUsableChannels: Location_Nearby_Connections_WifiDirectCliUsableChannels { - get {return _storage._wifiDirectCliUsableChannels ?? Location_Nearby_Connections_WifiDirectCliUsableChannels()} + get {_storage._wifiDirectCliUsableChannels ?? Location_Nearby_Connections_WifiDirectCliUsableChannels()} set {_uniqueStorage()._wifiDirectCliUsableChannels = newValue} } /// Returns true if `wifiDirectCliUsableChannels` has been explicitly set. - var hasWifiDirectCliUsableChannels: Bool {return _storage._wifiDirectCliUsableChannels != nil} + var hasWifiDirectCliUsableChannels: Bool {_storage._wifiDirectCliUsableChannels != nil} /// Clears the value of `wifiDirectCliUsableChannels`. Subsequent reads from it will return its default value. mutating func clearWifiDirectCliUsableChannels() {_uniqueStorage()._wifiDirectCliUsableChannels = nil} /// Usable WiFi LAN channels on the local device. var wifiLanUsableChannels: Location_Nearby_Connections_WifiLanUsableChannels { - get {return _storage._wifiLanUsableChannels ?? Location_Nearby_Connections_WifiLanUsableChannels()} + get {_storage._wifiLanUsableChannels ?? Location_Nearby_Connections_WifiLanUsableChannels()} set {_uniqueStorage()._wifiLanUsableChannels = newValue} } /// Returns true if `wifiLanUsableChannels` has been explicitly set. - var hasWifiLanUsableChannels: Bool {return _storage._wifiLanUsableChannels != nil} + var hasWifiLanUsableChannels: Bool {_storage._wifiLanUsableChannels != nil} /// Clears the value of `wifiLanUsableChannels`. Subsequent reads from it will return its default value. mutating func clearWifiLanUsableChannels() {_uniqueStorage()._wifiLanUsableChannels = nil} /// Usable WiFi Aware channels on the local device. var wifiAwareUsableChannels: Location_Nearby_Connections_WifiAwareUsableChannels { - get {return _storage._wifiAwareUsableChannels ?? Location_Nearby_Connections_WifiAwareUsableChannels()} + get {_storage._wifiAwareUsableChannels ?? Location_Nearby_Connections_WifiAwareUsableChannels()} set {_uniqueStorage()._wifiAwareUsableChannels = newValue} } /// Returns true if `wifiAwareUsableChannels` has been explicitly set. - var hasWifiAwareUsableChannels: Bool {return _storage._wifiAwareUsableChannels != nil} + var hasWifiAwareUsableChannels: Bool {_storage._wifiAwareUsableChannels != nil} /// Clears the value of `wifiAwareUsableChannels`. Subsequent reads from it will return its default value. mutating func clearWifiAwareUsableChannels() {_uniqueStorage()._wifiAwareUsableChannels = nil} /// Usable WiFi Hotspot STA channels on the local device. var wifiHotspotStaUsableChannels: Location_Nearby_Connections_WifiHotspotStaUsableChannels { - get {return _storage._wifiHotspotStaUsableChannels ?? Location_Nearby_Connections_WifiHotspotStaUsableChannels()} + get {_storage._wifiHotspotStaUsableChannels ?? Location_Nearby_Connections_WifiHotspotStaUsableChannels()} set {_uniqueStorage()._wifiHotspotStaUsableChannels = newValue} } /// Returns true if `wifiHotspotStaUsableChannels` has been explicitly set. - var hasWifiHotspotStaUsableChannels: Bool {return _storage._wifiHotspotStaUsableChannels != nil} + var hasWifiHotspotStaUsableChannels: Bool {_storage._wifiHotspotStaUsableChannels != nil} /// Clears the value of `wifiHotspotStaUsableChannels`. Subsequent reads from it will return its default value. mutating func clearWifiHotspotStaUsableChannels() {_uniqueStorage()._wifiHotspotStaUsableChannels = nil} /// The supported medium roles. var mediumRole: Location_Nearby_Connections_MediumRole { - get {return _storage._mediumRole ?? Location_Nearby_Connections_MediumRole()} + get {_storage._mediumRole ?? Location_Nearby_Connections_MediumRole()} set {_uniqueStorage()._mediumRole = newValue} } /// Returns true if `mediumRole` has been explicitly set. - var hasMediumRole: Bool {return _storage._mediumRole != nil} + var hasMediumRole: Bool {_storage._mediumRole != nil} /// Clears the value of `mediumRole`. Subsequent reads from it will return its default value. mutating func clearMediumRole() {_uniqueStorage()._mediumRole = nil} @@ -2389,7 +1929,7 @@ struct Location_Nearby_Connections_MediumMetadata { } /// Available channels on the local device. -struct Location_Nearby_Connections_AvailableChannels { +nonisolated struct Location_Nearby_Connections_AvailableChannels: Sendable { // 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. @@ -2402,7 +1942,7 @@ struct Location_Nearby_Connections_AvailableChannels { } /// Usable WiFi Direct client channels on the local device. -struct Location_Nearby_Connections_WifiDirectCliUsableChannels { +nonisolated struct Location_Nearby_Connections_WifiDirectCliUsableChannels: Sendable { // 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. @@ -2415,7 +1955,7 @@ struct Location_Nearby_Connections_WifiDirectCliUsableChannels { } /// Usable WiFi LAN channels on the local device. -struct Location_Nearby_Connections_WifiLanUsableChannels { +nonisolated struct Location_Nearby_Connections_WifiLanUsableChannels: Sendable { // 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. @@ -2428,7 +1968,7 @@ struct Location_Nearby_Connections_WifiLanUsableChannels { } /// Usable WiFi Aware channels on the local device. -struct Location_Nearby_Connections_WifiAwareUsableChannels { +nonisolated struct Location_Nearby_Connections_WifiAwareUsableChannels: Sendable { // 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. @@ -2441,7 +1981,7 @@ struct Location_Nearby_Connections_WifiAwareUsableChannels { } /// Usable WiFi Hotspot STA channels on the local device. -struct Location_Nearby_Connections_WifiHotspotStaUsableChannels { +nonisolated struct Location_Nearby_Connections_WifiHotspotStaUsableChannels: Sendable { // 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. @@ -2454,80 +1994,80 @@ struct Location_Nearby_Connections_WifiHotspotStaUsableChannels { } /// The medium roles. -struct Location_Nearby_Connections_MediumRole { +nonisolated struct Location_Nearby_Connections_MediumRole: Sendable { // 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 supportWifiDirectGroupOwner: Bool { - get {return _supportWifiDirectGroupOwner ?? false} + get {_supportWifiDirectGroupOwner ?? false} set {_supportWifiDirectGroupOwner = newValue} } /// Returns true if `supportWifiDirectGroupOwner` has been explicitly set. - var hasSupportWifiDirectGroupOwner: Bool {return self._supportWifiDirectGroupOwner != nil} + var hasSupportWifiDirectGroupOwner: Bool {self._supportWifiDirectGroupOwner != nil} /// Clears the value of `supportWifiDirectGroupOwner`. Subsequent reads from it will return its default value. mutating func clearSupportWifiDirectGroupOwner() {self._supportWifiDirectGroupOwner = nil} var supportWifiDirectGroupClient: Bool { - get {return _supportWifiDirectGroupClient ?? false} + get {_supportWifiDirectGroupClient ?? false} set {_supportWifiDirectGroupClient = newValue} } /// Returns true if `supportWifiDirectGroupClient` has been explicitly set. - var hasSupportWifiDirectGroupClient: Bool {return self._supportWifiDirectGroupClient != nil} + var hasSupportWifiDirectGroupClient: Bool {self._supportWifiDirectGroupClient != nil} /// Clears the value of `supportWifiDirectGroupClient`. Subsequent reads from it will return its default value. mutating func clearSupportWifiDirectGroupClient() {self._supportWifiDirectGroupClient = nil} var supportWifiHotspotHost: Bool { - get {return _supportWifiHotspotHost ?? false} + get {_supportWifiHotspotHost ?? false} set {_supportWifiHotspotHost = newValue} } /// Returns true if `supportWifiHotspotHost` has been explicitly set. - var hasSupportWifiHotspotHost: Bool {return self._supportWifiHotspotHost != nil} + var hasSupportWifiHotspotHost: Bool {self._supportWifiHotspotHost != nil} /// Clears the value of `supportWifiHotspotHost`. Subsequent reads from it will return its default value. mutating func clearSupportWifiHotspotHost() {self._supportWifiHotspotHost = nil} var supportWifiHotspotClient: Bool { - get {return _supportWifiHotspotClient ?? false} + get {_supportWifiHotspotClient ?? false} set {_supportWifiHotspotClient = newValue} } /// Returns true if `supportWifiHotspotClient` has been explicitly set. - var hasSupportWifiHotspotClient: Bool {return self._supportWifiHotspotClient != nil} + var hasSupportWifiHotspotClient: Bool {self._supportWifiHotspotClient != nil} /// Clears the value of `supportWifiHotspotClient`. Subsequent reads from it will return its default value. mutating func clearSupportWifiHotspotClient() {self._supportWifiHotspotClient = nil} var supportWifiAwarePublisher: Bool { - get {return _supportWifiAwarePublisher ?? false} + get {_supportWifiAwarePublisher ?? false} set {_supportWifiAwarePublisher = newValue} } /// Returns true if `supportWifiAwarePublisher` has been explicitly set. - var hasSupportWifiAwarePublisher: Bool {return self._supportWifiAwarePublisher != nil} + var hasSupportWifiAwarePublisher: Bool {self._supportWifiAwarePublisher != nil} /// Clears the value of `supportWifiAwarePublisher`. Subsequent reads from it will return its default value. mutating func clearSupportWifiAwarePublisher() {self._supportWifiAwarePublisher = nil} var supportWifiAwareSubscriber: Bool { - get {return _supportWifiAwareSubscriber ?? false} + get {_supportWifiAwareSubscriber ?? false} set {_supportWifiAwareSubscriber = newValue} } /// Returns true if `supportWifiAwareSubscriber` has been explicitly set. - var hasSupportWifiAwareSubscriber: Bool {return self._supportWifiAwareSubscriber != nil} + var hasSupportWifiAwareSubscriber: Bool {self._supportWifiAwareSubscriber != nil} /// Clears the value of `supportWifiAwareSubscriber`. Subsequent reads from it will return its default value. mutating func clearSupportWifiAwareSubscriber() {self._supportWifiAwareSubscriber = nil} var supportAwdlPublisher: Bool { - get {return _supportAwdlPublisher ?? false} + get {_supportAwdlPublisher ?? false} set {_supportAwdlPublisher = newValue} } /// Returns true if `supportAwdlPublisher` has been explicitly set. - var hasSupportAwdlPublisher: Bool {return self._supportAwdlPublisher != nil} + var hasSupportAwdlPublisher: Bool {self._supportAwdlPublisher != nil} /// Clears the value of `supportAwdlPublisher`. Subsequent reads from it will return its default value. mutating func clearSupportAwdlPublisher() {self._supportAwdlPublisher = nil} var supportAwdlSubscriber: Bool { - get {return _supportAwdlSubscriber ?? false} + get {_supportAwdlSubscriber ?? false} set {_supportAwdlSubscriber = newValue} } /// Returns true if `supportAwdlSubscriber` has been explicitly set. - var hasSupportAwdlSubscriber: Bool {return self._supportAwdlSubscriber != nil} + var hasSupportAwdlSubscriber: Bool {self._supportAwdlSubscriber != nil} /// Clears the value of `supportAwdlSubscriber`. Subsequent reads from it will return its default value. mutating func clearSupportAwdlSubscriber() {self._supportAwdlSubscriber = nil} @@ -2546,28 +2086,28 @@ struct Location_Nearby_Connections_MediumRole { } /// LocationHint is used to specify a location as well as format. -struct Location_Nearby_Connections_LocationHint { +nonisolated struct Location_Nearby_Connections_LocationHint: Sendable { // 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. /// Location is the location, provided in the format specified by format. var location: String { - get {return _location ?? String()} + get {_location ?? String()} set {_location = newValue} } /// Returns true if `location` has been explicitly set. - var hasLocation: Bool {return self._location != nil} + var hasLocation: Bool {self._location != nil} /// Clears the value of `location`. Subsequent reads from it will return its default value. mutating func clearLocation() {self._location = nil} /// the format of location. var format: Location_Nearby_Connections_LocationStandard.Format { - get {return _format ?? .unknown} + get {_format ?? .unknown} set {_format = newValue} } /// Returns true if `format` has been explicitly set. - var hasFormat: Bool {return self._format != nil} + var hasFormat: Bool {self._format != nil} /// Clears the value of `format`. Subsequent reads from it will return its default value. mutating func clearFormat() {self._format = nil} @@ -2579,115 +2119,65 @@ struct Location_Nearby_Connections_LocationHint { fileprivate var _format: Location_Nearby_Connections_LocationStandard.Format? = nil } -struct Location_Nearby_Connections_LocationStandard { +nonisolated struct Location_Nearby_Connections_LocationStandard: Sendable { // 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 Format: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 + enum Format: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 /// E164 country codes: /// https://en.wikipedia.org/wiki/List_of_country_calling_codes /// e.g. +1 for USA - case e164Calling // = 1 + case e164Calling = 1 /// ISO 3166-1 alpha-2 country codes: /// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - case iso31661Alpha2 // = 2 + case iso31661Alpha2 = 2 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .e164Calling - case 2: self = .iso31661Alpha2 - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .e164Calling: return 1 - case .iso31661Alpha2: return 2 - } - } - } init() {} } -#if swift(>=4.2) - -extension Location_Nearby_Connections_LocationStandard.Format: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// Device capability for OS information. -struct Location_Nearby_Connections_OsInfo { +nonisolated struct Location_Nearby_Connections_OsInfo: Sendable { // 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 type: Location_Nearby_Connections_OsInfo.OsType { - get {return _type ?? .unknownOsType} + get {_type ?? .unknownOsType} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum OsType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownOsType // = 0 - case android // = 1 - case chromeOs // = 2 - case windows // = 3 - case apple // = 4 + enum OsType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownOsType = 0 + case android = 1 + case chromeOs = 2 + case windows = 3 + case apple = 4 /// g3 test environment - case linux // = 100 + case linux = 100 init() { self = .unknownOsType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownOsType - case 1: self = .android - case 2: self = .chromeOs - case 3: self = .windows - case 4: self = .apple - case 100: self = .linux - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownOsType: return 0 - case .android: return 1 - case .chromeOs: return 2 - case .windows: return 3 - case .apple: return 4 - case .linux: return 100 - } - } - } init() {} @@ -2695,53 +2185,45 @@ struct Location_Nearby_Connections_OsInfo { fileprivate var _type: Location_Nearby_Connections_OsInfo.OsType? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_OsInfo.OsType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Location_Nearby_Connections_ConnectionsDevice { +nonisolated struct Location_Nearby_Connections_ConnectionsDevice: Sendable { // 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 endpointID: String { - get {return _endpointID ?? String()} + get {_endpointID ?? String()} set {_endpointID = newValue} } /// Returns true if `endpointID` has been explicitly set. - var hasEndpointID: Bool {return self._endpointID != nil} + var hasEndpointID: Bool {self._endpointID != nil} /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. mutating func clearEndpointID() {self._endpointID = nil} var endpointType: Location_Nearby_Connections_EndpointType { - get {return _endpointType ?? .unknownEndpoint} + get {_endpointType ?? .unknownEndpoint} set {_endpointType = newValue} } /// Returns true if `endpointType` has been explicitly set. - var hasEndpointType: Bool {return self._endpointType != nil} + var hasEndpointType: Bool {self._endpointType != nil} /// Clears the value of `endpointType`. Subsequent reads from it will return its default value. mutating func clearEndpointType() {self._endpointType = nil} /// Data Elements. var connectivityInfoList: Data { - get {return _connectivityInfoList ?? Data()} + get {_connectivityInfoList ?? Data()} set {_connectivityInfoList = newValue} } /// Returns true if `connectivityInfoList` has been explicitly set. - var hasConnectivityInfoList: Bool {return self._connectivityInfoList != nil} + var hasConnectivityInfoList: Bool {self._connectivityInfoList != nil} /// Clears the value of `connectivityInfoList`. Subsequent reads from it will return its default value. mutating func clearConnectivityInfoList() {self._connectivityInfoList = nil} var endpointInfo: Data { - get {return _endpointInfo ?? Data()} + get {_endpointInfo ?? Data()} set {_endpointInfo = newValue} } /// Returns true if `endpointInfo` has been explicitly set. - var hasEndpointInfo: Bool {return self._endpointInfo != nil} + var hasEndpointInfo: Bool {self._endpointInfo != nil} /// Clears the value of `endpointInfo`. Subsequent reads from it will return its default value. mutating func clearEndpointInfo() {self._endpointInfo = nil} @@ -2755,72 +2237,72 @@ struct Location_Nearby_Connections_ConnectionsDevice { fileprivate var _endpointInfo: Data? = nil } -struct Location_Nearby_Connections_PresenceDevice { +nonisolated struct Location_Nearby_Connections_PresenceDevice: Sendable { // 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 endpointID: String { - get {return _endpointID ?? String()} + get {_endpointID ?? String()} set {_endpointID = newValue} } /// Returns true if `endpointID` has been explicitly set. - var hasEndpointID: Bool {return self._endpointID != nil} + var hasEndpointID: Bool {self._endpointID != nil} /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. mutating func clearEndpointID() {self._endpointID = nil} var endpointType: Location_Nearby_Connections_EndpointType { - get {return _endpointType ?? .unknownEndpoint} + get {_endpointType ?? .unknownEndpoint} set {_endpointType = newValue} } /// Returns true if `endpointType` has been explicitly set. - var hasEndpointType: Bool {return self._endpointType != nil} + var hasEndpointType: Bool {self._endpointType != nil} /// Clears the value of `endpointType`. Subsequent reads from it will return its default value. mutating func clearEndpointType() {self._endpointType = nil} /// Data Elements. var connectivityInfoList: Data { - get {return _connectivityInfoList ?? Data()} + get {_connectivityInfoList ?? Data()} set {_connectivityInfoList = newValue} } /// Returns true if `connectivityInfoList` has been explicitly set. - var hasConnectivityInfoList: Bool {return self._connectivityInfoList != nil} + var hasConnectivityInfoList: Bool {self._connectivityInfoList != nil} /// Clears the value of `connectivityInfoList`. Subsequent reads from it will return its default value. mutating func clearConnectivityInfoList() {self._connectivityInfoList = nil} var deviceID: Int64 { - get {return _deviceID ?? 0} + get {_deviceID ?? 0} set {_deviceID = newValue} } /// Returns true if `deviceID` has been explicitly set. - var hasDeviceID: Bool {return self._deviceID != nil} + var hasDeviceID: Bool {self._deviceID != nil} /// Clears the value of `deviceID`. Subsequent reads from it will return its default value. mutating func clearDeviceID() {self._deviceID = nil} var deviceName: String { - get {return _deviceName ?? String()} + get {_deviceName ?? String()} set {_deviceName = newValue} } /// Returns true if `deviceName` has been explicitly set. - var hasDeviceName: Bool {return self._deviceName != nil} + var hasDeviceName: Bool {self._deviceName != nil} /// Clears the value of `deviceName`. Subsequent reads from it will return its default value. mutating func clearDeviceName() {self._deviceName = nil} var deviceType: Location_Nearby_Connections_PresenceDevice.DeviceType { - get {return _deviceType ?? .unknown} + get {_deviceType ?? .unknown} set {_deviceType = newValue} } /// Returns true if `deviceType` has been explicitly set. - var hasDeviceType: Bool {return self._deviceType != nil} + var hasDeviceType: Bool {self._deviceType != nil} /// Clears the value of `deviceType`. Subsequent reads from it will return its default value. mutating func clearDeviceType() {self._deviceType = nil} var deviceImageURL: String { - get {return _deviceImageURL ?? String()} + get {_deviceImageURL ?? String()} set {_deviceImageURL = newValue} } /// Returns true if `deviceImageURL` has been explicitly set. - var hasDeviceImageURL: Bool {return self._deviceImageURL != nil} + var hasDeviceImageURL: Bool {self._deviceImageURL != nil} /// Clears the value of `deviceImageURL`. Subsequent reads from it will return its default value. mutating func clearDeviceImageURL() {self._deviceImageURL = nil} @@ -2832,45 +2314,19 @@ struct Location_Nearby_Connections_PresenceDevice { var unknownFields = SwiftProtobuf.UnknownStorage() - enum DeviceType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case phone // = 1 - case tablet // = 2 - case display // = 3 - case laptop // = 4 - case tv // = 5 - case watch // = 6 + enum DeviceType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case phone = 1 + case tablet = 2 + case display = 3 + case laptop = 4 + case tv = 5 + case watch = 6 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .phone - case 2: self = .tablet - case 3: self = .display - case 4: self = .laptop - case 5: self = .tv - case 6: self = .watch - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .phone: return 1 - case .tablet: return 2 - case .display: return 3 - case .laptop: return 4 - case .tv: return 5 - case .watch: return 6 - } - } - } init() {} @@ -2884,95 +2340,17 @@ struct Location_Nearby_Connections_PresenceDevice { fileprivate var _deviceImageURL: String? = nil } -#if swift(>=4.2) - -extension Location_Nearby_Connections_PresenceDevice.DeviceType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -#if swift(>=5.5) && canImport(_Concurrency) -extension Location_Nearby_Connections_EndpointType: @unchecked Sendable {} -extension Location_Nearby_Connections_OfflineFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_OfflineFrame.Version: @unchecked Sendable {} -extension Location_Nearby_Connections_V1Frame: @unchecked Sendable {} -extension Location_Nearby_Connections_V1Frame.FrameType: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionRequestFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionResponseFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionResponseFrame.ResponseStatus: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.PacketType: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader.PayloadType: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk.Flags: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage: @unchecked Sendable {} -extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage.EventType: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.EventType: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiHotspotCredentials: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiLanSocket: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.BluetoothCredentials: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: @unchecked Sendable {} -extension Location_Nearby_Connections_KeepAliveFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_DisconnectionFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_PairedKeyEncryptionFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_AuthenticationMessageFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_AuthenticationResultFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_AutoResumeFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_AutoResumeFrame.EventType: @unchecked Sendable {} -extension Location_Nearby_Connections_AutoReconnectFrame: @unchecked Sendable {} -extension Location_Nearby_Connections_AutoReconnectFrame.EventType: @unchecked Sendable {} -extension Location_Nearby_Connections_MediumMetadata: @unchecked Sendable {} -extension Location_Nearby_Connections_AvailableChannels: @unchecked Sendable {} -extension Location_Nearby_Connections_WifiDirectCliUsableChannels: @unchecked Sendable {} -extension Location_Nearby_Connections_WifiLanUsableChannels: @unchecked Sendable {} -extension Location_Nearby_Connections_WifiAwareUsableChannels: @unchecked Sendable {} -extension Location_Nearby_Connections_WifiHotspotStaUsableChannels: @unchecked Sendable {} -extension Location_Nearby_Connections_MediumRole: @unchecked Sendable {} -extension Location_Nearby_Connections_LocationHint: @unchecked Sendable {} -extension Location_Nearby_Connections_LocationStandard: @unchecked Sendable {} -extension Location_Nearby_Connections_LocationStandard.Format: @unchecked Sendable {} -extension Location_Nearby_Connections_OsInfo: @unchecked Sendable {} -extension Location_Nearby_Connections_OsInfo.OsType: @unchecked Sendable {} -extension Location_Nearby_Connections_ConnectionsDevice: @unchecked Sendable {} -extension Location_Nearby_Connections_PresenceDevice: @unchecked Sendable {} -extension Location_Nearby_Connections_PresenceDevice.DeviceType: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "location.nearby.connections" +nonisolated fileprivate let _protobuf_package = "location.nearby.connections" -extension Location_Nearby_Connections_EndpointType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_ENDPOINT"), - 1: .same(proto: "CONNECTIONS_ENDPOINT"), - 2: .same(proto: "PRESENCE_ENDPOINT"), - ] +nonisolated extension Location_Nearby_Connections_EndpointType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_ENDPOINT\0\u{1}CONNECTIONS_ENDPOINT\0\u{1}PRESENCE_ENDPOINT\0") } -extension Location_Nearby_Connections_OfflineFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_OfflineFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".OfflineFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "version"), - 2: .same(proto: "v1"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}v1\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3009,30 +2387,13 @@ extension Location_Nearby_Connections_OfflineFrame: @preconcurrency SwiftProtobu } } -extension Location_Nearby_Connections_OfflineFrame.Version: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_VERSION"), - 1: .same(proto: "V1"), - ] +nonisolated extension Location_Nearby_Connections_OfflineFrame.Version: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_VERSION\0\u{1}V1\0") } -extension Location_Nearby_Connections_V1Frame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".V1Frame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .standard(proto: "connection_request"), - 3: .standard(proto: "connection_response"), - 4: .standard(proto: "payload_transfer"), - 5: .standard(proto: "bandwidth_upgrade_negotiation"), - 6: .standard(proto: "keep_alive"), - 7: .same(proto: "disconnection"), - 8: .standard(proto: "paired_key_encryption"), - 9: .standard(proto: "authentication_message"), - 10: .standard(proto: "authentication_result"), - 11: .standard(proto: "auto_resume"), - 12: .standard(proto: "auto_reconnect"), - 13: .standard(proto: "bandwidth_upgrade_retry"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}connection_request\0\u{3}connection_response\0\u{3}payload_transfer\0\u{3}bandwidth_upgrade_negotiation\0\u{3}keep_alive\0\u{1}disconnection\0\u{3}paired_key_encryption\0\u{3}authentication_message\0\u{3}authentication_result\0\u{3}auto_resume\0\u{3}auto_reconnect\0\u{3}bandwidth_upgrade_retry\0") fileprivate class _StorageClass { var _type: Location_Nearby_Connections_V1Frame.FrameType? = nil @@ -3049,7 +2410,11 @@ extension Location_Nearby_Connections_V1Frame: @preconcurrency SwiftProtobuf.Mes var _autoReconnect: Location_Nearby_Connections_AutoReconnectFrame? = nil var _bandwidthUpgradeRetry: Location_Nearby_Connections_BandwidthUpgradeRetryFrame? = nil - static let defaultInstance = _StorageClass() + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() private init() {} @@ -3180,43 +2545,13 @@ extension Location_Nearby_Connections_V1Frame: @preconcurrency SwiftProtobuf.Mes } } -extension Location_Nearby_Connections_V1Frame.FrameType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_FRAME_TYPE"), - 1: .same(proto: "CONNECTION_REQUEST"), - 2: .same(proto: "CONNECTION_RESPONSE"), - 3: .same(proto: "PAYLOAD_TRANSFER"), - 4: .same(proto: "BANDWIDTH_UPGRADE_NEGOTIATION"), - 5: .same(proto: "KEEP_ALIVE"), - 6: .same(proto: "DISCONNECTION"), - 7: .same(proto: "PAIRED_KEY_ENCRYPTION"), - 8: .same(proto: "AUTHENTICATION_MESSAGE"), - 9: .same(proto: "AUTHENTICATION_RESULT"), - 10: .same(proto: "AUTO_RESUME"), - 11: .same(proto: "AUTO_RECONNECT"), - 12: .same(proto: "BANDWIDTH_UPGRADE_RETRY"), - ] +nonisolated extension Location_Nearby_Connections_V1Frame.FrameType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_FRAME_TYPE\0\u{1}CONNECTION_REQUEST\0\u{1}CONNECTION_RESPONSE\0\u{1}PAYLOAD_TRANSFER\0\u{1}BANDWIDTH_UPGRADE_NEGOTIATION\0\u{1}KEEP_ALIVE\0\u{1}DISCONNECTION\0\u{1}PAIRED_KEY_ENCRYPTION\0\u{1}AUTHENTICATION_MESSAGE\0\u{1}AUTHENTICATION_RESULT\0\u{1}AUTO_RESUME\0\u{1}AUTO_RECONNECT\0\u{1}BANDWIDTH_UPGRADE_RETRY\0") } -extension Location_Nearby_Connections_ConnectionRequestFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ConnectionRequestFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "endpoint_id"), - 2: .standard(proto: "endpoint_name"), - 3: .standard(proto: "handshake_data"), - 4: .same(proto: "nonce"), - 5: .same(proto: "mediums"), - 6: .standard(proto: "endpoint_info"), - 7: .standard(proto: "medium_metadata"), - 8: .standard(proto: "keep_alive_interval_millis"), - 9: .standard(proto: "keep_alive_timeout_millis"), - 10: .standard(proto: "device_type"), - 11: .standard(proto: "device_info"), - 12: .standard(proto: "connections_device"), - 13: .standard(proto: "presence_device"), - 14: .standard(proto: "connection_mode"), - 15: .standard(proto: "location_hint"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}endpoint_id\0\u{3}endpoint_name\0\u{3}handshake_data\0\u{1}nonce\0\u{1}mediums\0\u{3}endpoint_info\0\u{3}medium_metadata\0\u{3}keep_alive_interval_millis\0\u{3}keep_alive_timeout_millis\0\u{3}device_type\0\u{3}device_info\0\u{3}connections_device\0\u{3}presence_device\0\u{3}connection_mode\0\u{3}location_hint\0") fileprivate class _StorageClass { var _endpointID: String? = nil @@ -3234,7 +2569,11 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: @preconcurrency Sw var _connectionMode: Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode? = nil var _locationHint: Location_Nearby_Connections_LocationHint? = nil - static let defaultInstance = _StorageClass() + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() private init() {} @@ -3404,45 +2743,17 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: @preconcurrency Sw } } -extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_MEDIUM"), - 1: .same(proto: "MDNS"), - 2: .same(proto: "BLUETOOTH"), - 3: .same(proto: "WIFI_HOTSPOT"), - 4: .same(proto: "BLE"), - 5: .same(proto: "WIFI_LAN"), - 6: .same(proto: "WIFI_AWARE"), - 7: .same(proto: "NFC"), - 8: .same(proto: "WIFI_DIRECT"), - 9: .same(proto: "WEB_RTC"), - 10: .same(proto: "BLE_L2CAP"), - 11: .same(proto: "USB"), - 12: .same(proto: "WEB_RTC_NON_CELLULAR"), - 13: .same(proto: "AWDL"), - ] +nonisolated extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_MEDIUM\0\u{1}MDNS\0\u{1}BLUETOOTH\0\u{1}WIFI_HOTSPOT\0\u{1}BLE\0\u{1}WIFI_LAN\0\u{1}WIFI_AWARE\0\u{1}NFC\0\u{1}WIFI_DIRECT\0\u{1}WEB_RTC\0\u{1}BLE_L2CAP\0\u{1}USB\0\u{1}WEB_RTC_NON_CELLULAR\0\u{1}AWDL\0") } -extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "LEGACY"), - 1: .same(proto: "INSTANT"), - ] +nonisolated extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0LEGACY\0\u{1}INSTANT\0") } -extension Location_Nearby_Connections_ConnectionResponseFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_ConnectionResponseFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ConnectionResponseFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "status"), - 2: .standard(proto: "handshake_data"), - 3: .same(proto: "response"), - 4: .standard(proto: "os_info"), - 5: .standard(proto: "multiplex_socket_bitmask"), - 6: .standard(proto: "nearby_connections_version"), - 7: .standard(proto: "safe_to_disconnect_version"), - 8: .standard(proto: "location_hint"), - 9: .standard(proto: "keep_alive_timeout_millis"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}status\0\u{3}handshake_data\0\u{1}response\0\u{3}os_info\0\u{3}multiplex_socket_bitmask\0\u{3}nearby_connections_version\0\u{3}safe_to_disconnect_version\0\u{3}location_hint\0\u{3}keep_alive_timeout_millis\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3514,22 +2825,13 @@ extension Location_Nearby_Connections_ConnectionResponseFrame: @preconcurrency S } } -extension Location_Nearby_Connections_ConnectionResponseFrame.ResponseStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_RESPONSE_STATUS"), - 1: .same(proto: "ACCEPT"), - 2: .same(proto: "REJECT"), - ] +nonisolated extension Location_Nearby_Connections_ConnectionResponseFrame.ResponseStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_RESPONSE_STATUS\0\u{1}ACCEPT\0\u{1}REJECT\0") } -extension Location_Nearby_Connections_PayloadTransferFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PayloadTransferFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "packet_type"), - 2: .standard(proto: "payload_header"), - 3: .standard(proto: "payload_chunk"), - 4: .standard(proto: "control_message"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}packet_type\0\u{3}payload_header\0\u{3}payload_chunk\0\u{3}control_message\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3576,26 +2878,13 @@ extension Location_Nearby_Connections_PayloadTransferFrame: @preconcurrency Swif } } -extension Location_Nearby_Connections_PayloadTransferFrame.PacketType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_PACKET_TYPE"), - 1: .same(proto: "DATA"), - 2: .same(proto: "CONTROL"), - 3: .same(proto: "PAYLOAD_ACK"), - ] +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.PacketType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_PACKET_TYPE\0\u{1}DATA\0\u{1}CONTROL\0\u{1}PAYLOAD_ACK\0") } -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_PayloadTransferFrame.protoMessageName + ".PayloadHeader" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "type"), - 3: .standard(proto: "total_size"), - 4: .standard(proto: "is_sensitive"), - 5: .standard(proto: "file_name"), - 6: .standard(proto: "parent_folder"), - 7: .standard(proto: "last_modified_timestamp_millis"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}type\0\u{3}total_size\0\u{3}is_sensitive\0\u{3}file_name\0\u{3}parent_folder\0\u{3}last_modified_timestamp_millis\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3657,23 +2946,13 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: @preco } } -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader.PayloadType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_PAYLOAD_TYPE"), - 1: .same(proto: "BYTES"), - 2: .same(proto: "FILE"), - 3: .same(proto: "STREAM"), - ] +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader.PayloadType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_PAYLOAD_TYPE\0\u{1}BYTES\0\u{1}FILE\0\u{1}STREAM\0") } -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_PayloadTransferFrame.protoMessageName + ".PayloadChunk" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "flags"), - 2: .same(proto: "offset"), - 3: .same(proto: "body"), - 4: .same(proto: "index"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}flags\0\u{1}offset\0\u{1}body\0\u{1}index\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3720,18 +2999,13 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: @precon } } -extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk.Flags: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "LAST_CHUNK"), - ] +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk.Flags: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}LAST_CHUNK\0") } -extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_PayloadTransferFrame.protoMessageName + ".ControlMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "event"), - 2: .same(proto: "offset"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}event\0\u{1}offset\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3768,24 +3042,13 @@ extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage: @prec } } -extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage.EventType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_EVENT_TYPE"), - 1: .same(proto: "PAYLOAD_ERROR"), - 2: .same(proto: "PAYLOAD_CANCELED"), - 3: .same(proto: "PAYLOAD_RECEIVED_ACK"), - ] +nonisolated extension Location_Nearby_Connections_PayloadTransferFrame.ControlMessage.EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_EVENT_TYPE\0\u{1}PAYLOAD_ERROR\0\u{1}PAYLOAD_CANCELED\0\u{1}PAYLOAD_RECEIVED_ACK\0") } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".BandwidthUpgradeNegotiationFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "event_type"), - 2: .standard(proto: "upgrade_path_info"), - 3: .standard(proto: "client_introduction"), - 4: .standard(proto: "client_introduction_ack"), - 5: .standard(proto: "safe_to_close_prior_channel"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}event_type\0\u{3}upgrade_path_info\0\u{3}client_introduction\0\u{3}client_introduction_ack\0\u{3}safe_to_close_prior_channel\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3837,34 +3100,13 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: @preconc } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.EventType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_EVENT_TYPE"), - 1: .same(proto: "UPGRADE_PATH_AVAILABLE"), - 2: .same(proto: "LAST_WRITE_TO_PRIOR_CHANNEL"), - 3: .same(proto: "SAFE_TO_CLOSE_PRIOR_CHANNEL"), - 4: .same(proto: "CLIENT_INTRODUCTION"), - 5: .same(proto: "UPGRADE_FAILURE"), - 6: .same(proto: "CLIENT_INTRODUCTION_ACK"), - 7: .same(proto: "UPGRADE_PATH_REQUEST"), - ] +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_EVENT_TYPE\0\u{1}UPGRADE_PATH_AVAILABLE\0\u{1}LAST_WRITE_TO_PRIOR_CHANNEL\0\u{1}SAFE_TO_CLOSE_PRIOR_CHANNEL\0\u{1}CLIENT_INTRODUCTION\0\u{1}UPGRADE_FAILURE\0\u{1}CLIENT_INTRODUCTION_ACK\0\u{1}UPGRADE_PATH_REQUEST\0") } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.protoMessageName + ".UpgradePathInfo" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "medium"), - 2: .standard(proto: "wifi_hotspot_credentials"), - 3: .standard(proto: "wifi_lan_socket"), - 4: .standard(proto: "bluetooth_credentials"), - 5: .standard(proto: "wifi_aware_credentials"), - 6: .standard(proto: "wifi_direct_credentials"), - 8: .standard(proto: "web_rtc_credentials"), - 11: .standard(proto: "awdl_credentials"), - 7: .standard(proto: "supports_disabling_encryption"), - 9: .standard(proto: "supports_client_introduction_ack"), - 10: .standard(proto: "upgrade_path_request"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}medium\0\u{3}wifi_hotspot_credentials\0\u{3}wifi_lan_socket\0\u{3}bluetooth_credentials\0\u{3}wifi_aware_credentials\0\u{3}wifi_direct_credentials\0\u{3}supports_disabling_encryption\0\u{3}web_rtc_credentials\0\u{3}supports_client_introduction_ack\0\u{3}upgrade_path_request\0\u{3}awdl_credentials\0") fileprivate class _StorageClass { var _medium: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium? = nil @@ -3879,7 +3121,11 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa var _supportsClientIntroductionAck: Bool? = nil var _upgradePathRequest: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest? = nil - static let defaultInstance = _StorageClass() + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() private init() {} @@ -3998,33 +3244,13 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_MEDIUM"), - 1: .same(proto: "MDNS"), - 2: .same(proto: "BLUETOOTH"), - 3: .same(proto: "WIFI_HOTSPOT"), - 4: .same(proto: "BLE"), - 5: .same(proto: "WIFI_LAN"), - 6: .same(proto: "WIFI_AWARE"), - 7: .same(proto: "NFC"), - 8: .same(proto: "WIFI_DIRECT"), - 9: .same(proto: "WEB_RTC"), - 11: .same(proto: "USB"), - 12: .same(proto: "WEB_RTC_NON_CELLULAR"), - 13: .same(proto: "AWDL"), - ] +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_MEDIUM\0\u{1}MDNS\0\u{1}BLUETOOTH\0\u{1}WIFI_HOTSPOT\0\u{1}BLE\0\u{1}WIFI_LAN\0\u{1}WIFI_AWARE\0\u{1}NFC\0\u{1}WIFI_DIRECT\0\u{1}WEB_RTC\0\u{2}\u{2}USB\0\u{1}WEB_RTC_NON_CELLULAR\0\u{1}AWDL\0") } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiHotspotCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiHotspotCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".WifiHotspotCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "ssid"), - 2: .same(proto: "password"), - 3: .same(proto: "port"), - 4: .same(proto: "gateway"), - 5: .same(proto: "frequency"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ssid\0\u{1}password\0\u{1}port\0\u{1}gateway\0\u{1}frequency\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4076,12 +3302,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiLanSocket: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiLanSocket: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".WifiLanSocket" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "ip_address"), - 2: .standard(proto: "wifi_port"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}ip_address\0\u{3}wifi_port\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4118,12 +3341,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.BluetoothCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.BluetoothCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".BluetoothCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "service_name"), - 2: .standard(proto: "mac_address"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}service_name\0\u{3}mac_address\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4160,13 +3380,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".WifiAwareCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "service_id"), - 2: .standard(proto: "service_info"), - 3: .same(proto: "password"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}service_id\0\u{3}service_info\0\u{1}password\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4208,16 +3424,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".WifiDirectCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "ssid"), - 2: .same(proto: "password"), - 3: .same(proto: "port"), - 4: .same(proto: "frequency"), - 5: .same(proto: "gateway"), - 6: .standard(proto: "ip_v6_address"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ssid\0\u{1}password\0\u{1}port\0\u{1}frequency\0\u{1}gateway\0\u{3}ip_v6_address\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4274,12 +3483,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".WebRtcCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "peer_id"), - 2: .standard(proto: "location_hint"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}peer_id\0\u{3}location_hint\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4316,13 +3522,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".AwdlCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "service_name"), - 2: .standard(proto: "service_type"), - 3: .same(proto: "password"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}service_name\0\u{3}service_type\0\u{1}password\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4364,12 +3566,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".UpgradePathRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "mediums"), - 2: .standard(proto: "medium_meta_data"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mediums\0\u{3}medium_meta_data\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4406,11 +3605,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.protoMessageName + ".SafeToClosePriorChannel" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "sta_frequency"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}sta_frequency\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4442,13 +3639,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClo } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.protoMessageName + ".ClientIntroduction" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "endpoint_id"), - 2: .standard(proto: "supports_disabling_encryption"), - 3: .standard(proto: "last_endpoint_id"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}endpoint_id\0\u{3}supports_disabling_encryption\0\u{3}last_endpoint_id\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4490,13 +3683,13 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientInt } } -extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.protoMessageName + ".ClientIntroductionAck" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -4509,12 +3702,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientInt } } -extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".BandwidthUpgradeRetryFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "supported_medium"), - 2: .standard(proto: "is_request"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}supported_medium\0\u{3}is_request\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4551,30 +3741,13 @@ extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame: @preconcurrenc } } -extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_MEDIUM"), - 2: .same(proto: "BLUETOOTH"), - 3: .same(proto: "WIFI_HOTSPOT"), - 4: .same(proto: "BLE"), - 5: .same(proto: "WIFI_LAN"), - 6: .same(proto: "WIFI_AWARE"), - 7: .same(proto: "NFC"), - 8: .same(proto: "WIFI_DIRECT"), - 9: .same(proto: "WEB_RTC"), - 10: .same(proto: "BLE_L2CAP"), - 11: .same(proto: "USB"), - 12: .same(proto: "WEB_RTC_NON_CELLULAR"), - 13: .same(proto: "AWDL"), - ] +nonisolated extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_MEDIUM\0\u{2}\u{2}BLUETOOTH\0\u{1}WIFI_HOTSPOT\0\u{1}BLE\0\u{1}WIFI_LAN\0\u{1}WIFI_AWARE\0\u{1}NFC\0\u{1}WIFI_DIRECT\0\u{1}WEB_RTC\0\u{1}BLE_L2CAP\0\u{1}USB\0\u{1}WEB_RTC_NON_CELLULAR\0\u{1}AWDL\0") } -extension Location_Nearby_Connections_KeepAliveFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_KeepAliveFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".KeepAliveFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "ack"), - 2: .standard(proto: "seq_num"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ack\0\u{3}seq_num\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4611,12 +3784,9 @@ extension Location_Nearby_Connections_KeepAliveFrame: @preconcurrency SwiftProto } } -extension Location_Nearby_Connections_DisconnectionFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_DisconnectionFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".DisconnectionFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "request_safe_to_disconnect"), - 2: .standard(proto: "ack_safe_to_disconnect"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}request_safe_to_disconnect\0\u{3}ack_safe_to_disconnect\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4653,11 +3823,9 @@ extension Location_Nearby_Connections_DisconnectionFrame: @preconcurrency SwiftP } } -extension Location_Nearby_Connections_PairedKeyEncryptionFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_PairedKeyEncryptionFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PairedKeyEncryptionFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "signed_data"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}signed_data\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4689,11 +3857,9 @@ extension Location_Nearby_Connections_PairedKeyEncryptionFrame: @preconcurrency } } -extension Location_Nearby_Connections_AuthenticationMessageFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_AuthenticationMessageFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AuthenticationMessageFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "auth_message"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}auth_message\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4725,11 +3891,9 @@ extension Location_Nearby_Connections_AuthenticationMessageFrame: @preconcurrenc } } -extension Location_Nearby_Connections_AuthenticationResultFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_AuthenticationResultFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AuthenticationResultFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4761,14 +3925,9 @@ extension Location_Nearby_Connections_AuthenticationResultFrame: @preconcurrency } } -extension Location_Nearby_Connections_AutoResumeFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_AutoResumeFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AutoResumeFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "event_type"), - 2: .standard(proto: "pending_payload_id"), - 3: .standard(proto: "next_payload_chunk_index"), - 4: .same(proto: "version"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}event_type\0\u{3}pending_payload_id\0\u{3}next_payload_chunk_index\0\u{1}version\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4815,21 +3974,13 @@ extension Location_Nearby_Connections_AutoResumeFrame: @preconcurrency SwiftProt } } -extension Location_Nearby_Connections_AutoResumeFrame.EventType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_AUTO_RESUME_EVENT_TYPE"), - 1: .same(proto: "PAYLOAD_RESUME_TRANSFER_START"), - 2: .same(proto: "PAYLOAD_RESUME_TRANSFER_ACK"), - ] +nonisolated extension Location_Nearby_Connections_AutoResumeFrame.EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_AUTO_RESUME_EVENT_TYPE\0\u{1}PAYLOAD_RESUME_TRANSFER_START\0\u{1}PAYLOAD_RESUME_TRANSFER_ACK\0") } -extension Location_Nearby_Connections_AutoReconnectFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_AutoReconnectFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AutoReconnectFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "endpoint_id"), - 2: .standard(proto: "event_type"), - 3: .standard(proto: "last_endpoint_id"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}endpoint_id\0\u{3}event_type\0\u{3}last_endpoint_id\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4871,30 +4022,13 @@ extension Location_Nearby_Connections_AutoReconnectFrame: @preconcurrency SwiftP } } -extension Location_Nearby_Connections_AutoReconnectFrame.EventType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_EVENT_TYPE"), - 1: .same(proto: "CLIENT_INTRODUCTION"), - 2: .same(proto: "CLIENT_INTRODUCTION_ACK"), - ] +nonisolated extension Location_Nearby_Connections_AutoReconnectFrame.EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_EVENT_TYPE\0\u{1}CLIENT_INTRODUCTION\0\u{1}CLIENT_INTRODUCTION_ACK\0") } -extension Location_Nearby_Connections_MediumMetadata: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_MediumMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MediumMetadata" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "supports_5_ghz"), - 2: .same(proto: "bssid"), - 3: .standard(proto: "ip_address"), - 4: .standard(proto: "supports_6_ghz"), - 5: .standard(proto: "mobile_radio"), - 6: .standard(proto: "ap_frequency"), - 7: .standard(proto: "available_channels"), - 8: .standard(proto: "wifi_direct_cli_usable_channels"), - 9: .standard(proto: "wifi_lan_usable_channels"), - 10: .standard(proto: "wifi_aware_usable_channels"), - 11: .standard(proto: "wifi_hotspot_sta_usable_channels"), - 12: .standard(proto: "medium_role"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}supports_5_ghz\0\u{1}bssid\0\u{3}ip_address\0\u{3}supports_6_ghz\0\u{3}mobile_radio\0\u{3}ap_frequency\0\u{3}available_channels\0\u{3}wifi_direct_cli_usable_channels\0\u{3}wifi_lan_usable_channels\0\u{3}wifi_aware_usable_channels\0\u{3}wifi_hotspot_sta_usable_channels\0\u{3}medium_role\0") fileprivate class _StorageClass { var _supports5Ghz: Bool? = nil @@ -4910,7 +4044,11 @@ extension Location_Nearby_Connections_MediumMetadata: @preconcurrency SwiftProto var _wifiHotspotStaUsableChannels: Location_Nearby_Connections_WifiHotspotStaUsableChannels? = nil var _mediumRole: Location_Nearby_Connections_MediumRole? = nil - static let defaultInstance = _StorageClass() + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() private init() {} @@ -5035,11 +4173,9 @@ extension Location_Nearby_Connections_MediumMetadata: @preconcurrency SwiftProto } } -extension Location_Nearby_Connections_AvailableChannels: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_AvailableChannels: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AvailableChannels" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "channels"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}channels\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5067,11 +4203,9 @@ extension Location_Nearby_Connections_AvailableChannels: @preconcurrency SwiftPr } } -extension Location_Nearby_Connections_WifiDirectCliUsableChannels: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_WifiDirectCliUsableChannels: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".WifiDirectCliUsableChannels" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "channels"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}channels\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5099,11 +4233,9 @@ extension Location_Nearby_Connections_WifiDirectCliUsableChannels: @preconcurren } } -extension Location_Nearby_Connections_WifiLanUsableChannels: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_WifiLanUsableChannels: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".WifiLanUsableChannels" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "channels"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}channels\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5131,11 +4263,9 @@ extension Location_Nearby_Connections_WifiLanUsableChannels: @preconcurrency Swi } } -extension Location_Nearby_Connections_WifiAwareUsableChannels: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_WifiAwareUsableChannels: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".WifiAwareUsableChannels" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "channels"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}channels\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5163,11 +4293,9 @@ extension Location_Nearby_Connections_WifiAwareUsableChannels: @preconcurrency S } } -extension Location_Nearby_Connections_WifiHotspotStaUsableChannels: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_WifiHotspotStaUsableChannels: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".WifiHotspotStaUsableChannels" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "channels"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}channels\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5195,18 +4323,9 @@ extension Location_Nearby_Connections_WifiHotspotStaUsableChannels: @preconcurre } } -extension Location_Nearby_Connections_MediumRole: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_MediumRole: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MediumRole" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "support_wifi_direct_group_owner"), - 2: .standard(proto: "support_wifi_direct_group_client"), - 3: .standard(proto: "support_wifi_hotspot_host"), - 4: .standard(proto: "support_wifi_hotspot_client"), - 5: .standard(proto: "support_wifi_aware_publisher"), - 6: .standard(proto: "support_wifi_aware_subscriber"), - 7: .standard(proto: "support_awdl_publisher"), - 8: .standard(proto: "support_awdl_subscriber"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}support_wifi_direct_group_owner\0\u{3}support_wifi_direct_group_client\0\u{3}support_wifi_hotspot_host\0\u{3}support_wifi_hotspot_client\0\u{3}support_wifi_aware_publisher\0\u{3}support_wifi_aware_subscriber\0\u{3}support_awdl_publisher\0\u{3}support_awdl_subscriber\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5273,12 +4392,9 @@ extension Location_Nearby_Connections_MediumRole: @preconcurrency SwiftProtobuf. } } -extension Location_Nearby_Connections_LocationHint: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_LocationHint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LocationHint" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "location"), - 2: .same(proto: "format"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}location\0\u{1}format\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5315,13 +4431,13 @@ extension Location_Nearby_Connections_LocationHint: @preconcurrency SwiftProtobu } } -extension Location_Nearby_Connections_LocationStandard: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_LocationStandard: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LocationStandard" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + // Load everything into unknown fields + while try decoder.nextFieldNumber() != nil {} } func traverse(visitor: inout V) throws { @@ -5334,19 +4450,13 @@ extension Location_Nearby_Connections_LocationStandard: @preconcurrency SwiftPro } } -extension Location_Nearby_Connections_LocationStandard.Format: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "E164_CALLING"), - 2: .same(proto: "ISO_3166_1_ALPHA_2"), - ] +nonisolated extension Location_Nearby_Connections_LocationStandard.Format: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}E164_CALLING\0\u{1}ISO_3166_1_ALPHA_2\0") } -extension Location_Nearby_Connections_OsInfo: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_OsInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".OsInfo" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5378,25 +4488,13 @@ extension Location_Nearby_Connections_OsInfo: @preconcurrency SwiftProtobuf.Mess } } -extension Location_Nearby_Connections_OsInfo.OsType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_OS_TYPE"), - 1: .same(proto: "ANDROID"), - 2: .same(proto: "CHROME_OS"), - 3: .same(proto: "WINDOWS"), - 4: .same(proto: "APPLE"), - 100: .same(proto: "LINUX"), - ] +nonisolated extension Location_Nearby_Connections_OsInfo.OsType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_OS_TYPE\0\u{1}ANDROID\0\u{1}CHROME_OS\0\u{1}WINDOWS\0\u{1}APPLE\0\u{2}`\u{1}LINUX\0") } -extension Location_Nearby_Connections_ConnectionsDevice: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_ConnectionsDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ConnectionsDevice" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "endpoint_id"), - 2: .standard(proto: "endpoint_type"), - 3: .standard(proto: "connectivity_info_list"), - 4: .standard(proto: "endpoint_info"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}endpoint_id\0\u{3}endpoint_type\0\u{3}connectivity_info_list\0\u{3}endpoint_info\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5443,20 +4541,9 @@ extension Location_Nearby_Connections_ConnectionsDevice: @preconcurrency SwiftPr } } -extension Location_Nearby_Connections_PresenceDevice: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Location_Nearby_Connections_PresenceDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PresenceDevice" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "endpoint_id"), - 2: .standard(proto: "endpoint_type"), - 3: .standard(proto: "connectivity_info_list"), - 4: .standard(proto: "device_id"), - 5: .standard(proto: "device_name"), - 6: .standard(proto: "device_type"), - 7: .standard(proto: "device_image_url"), - 8: .standard(proto: "discovery_medium"), - 9: .same(proto: "actions"), - 10: .standard(proto: "identity_type"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}endpoint_id\0\u{3}endpoint_type\0\u{3}connectivity_info_list\0\u{3}device_id\0\u{3}device_name\0\u{3}device_type\0\u{3}device_image_url\0\u{3}discovery_medium\0\u{1}actions\0\u{3}identity_type\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -5533,14 +4620,6 @@ extension Location_Nearby_Connections_PresenceDevice: @preconcurrency SwiftProto } } -extension Location_Nearby_Connections_PresenceDevice.DeviceType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "PHONE"), - 2: .same(proto: "TABLET"), - 3: .same(proto: "DISPLAY"), - 4: .same(proto: "LAPTOP"), - 5: .same(proto: "TV"), - 6: .same(proto: "WATCH"), - ] +nonisolated extension Location_Nearby_Connections_PresenceDevice.DeviceType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}PHONE\0\u{1}TABLET\0\u{1}DISPLAY\0\u{1}LAPTOP\0\u{1}TV\0\u{1}WATCH\0") } diff --git a/airsync-mac/Core/QuickShare/Protobuf/securegcm.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/securegcm.pb.swift index 0169b877..aead792c 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/securegcm.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/securegcm.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: securegcm.proto @@ -21,7 +22,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif @preconcurrency import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -30,284 +35,137 @@ import Foundation // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// This enum is used by iOS devices as values for device_display_diagonal_mils /// in GcmDeviceInfo. There is no good way to calculate it on those devices. -enum Securegcm_AppleDeviceDiagonalMils: SwiftProtobuf.Enum { - typealias RawValue = Int +enum Securegcm_AppleDeviceDiagonalMils: Int, SwiftProtobuf.Enum, Swift.CaseIterable { /// This is the mils diagonal on an iPhone 5. - case applePhone // = 4000 + case applePhone = 4000 /// This is the mils diagonal on an iPad mini. - case applePad // = 7900 + case applePad = 7900 init() { self = .applePhone } - init?(rawValue: Int) { - switch rawValue { - case 4000: self = .applePhone - case 7900: self = .applePad - default: return nil - } - } - - var rawValue: Int { - switch self { - case .applePhone: return 4000 - case .applePad: return 7900 - } - } - } -#if swift(>=4.2) - -extension Securegcm_AppleDeviceDiagonalMils: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// This should be kept in sync with DeviceType in: /// java/com/google/security/cryptauth/backend/services/common/common_enums.proto -enum Securegcm_DeviceType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case android // = 1 - case chrome // = 2 - case ios // = 3 - case browser // = 4 - case osx // = 5 +enum Securegcm_DeviceType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case android = 1 + case chrome = 2 + case ios = 3 + case browser = 4 + case osx = 5 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .android - case 2: self = .chrome - case 3: self = .ios - case 4: self = .browser - case 5: self = .osx - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .android: return 1 - case .chrome: return 2 - case .ios: return 3 - case .browser: return 4 - case .osx: return 5 - } - } - } -#if swift(>=4.2) - -extension Securegcm_DeviceType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// MultiDevice features which may be supported and enabled on a device. See -enum Securegcm_SoftwareFeature: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownFeature // = 0 - case betterTogetherHost // = 1 - case betterTogetherClient // = 2 - case easyUnlockHost // = 3 - case easyUnlockClient // = 4 - case magicTetherHost // = 5 - case magicTetherClient // = 6 - case smsConnectHost // = 7 - case smsConnectClient // = 8 +enum Securegcm_SoftwareFeature: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownFeature = 0 + case betterTogetherHost = 1 + case betterTogetherClient = 2 + case easyUnlockHost = 3 + case easyUnlockClient = 4 + case magicTetherHost = 5 + case magicTetherClient = 6 + case smsConnectHost = 7 + case smsConnectClient = 8 init() { self = .unknownFeature } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownFeature - case 1: self = .betterTogetherHost - case 2: self = .betterTogetherClient - case 3: self = .easyUnlockHost - case 4: self = .easyUnlockClient - case 5: self = .magicTetherHost - case 6: self = .magicTetherClient - case 7: self = .smsConnectHost - case 8: self = .smsConnectClient - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownFeature: return 0 - case .betterTogetherHost: return 1 - case .betterTogetherClient: return 2 - case .easyUnlockHost: return 3 - case .easyUnlockClient: return 4 - case .magicTetherHost: return 5 - case .magicTetherClient: return 6 - case .smsConnectHost: return 7 - case .smsConnectClient: return 8 - } - } - } -#if swift(>=4.2) - -extension Securegcm_SoftwareFeature: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// A list of "reasons" that can be provided for calling server-side APIs. /// This is particularly important for calls that can be triggered by different /// kinds of events. Please try to keep reasons as generic as possible, so that /// codes can be re-used by various callers in a sensible fashion. -enum Securegcm_InvocationReason: SwiftProtobuf.Enum { - typealias RawValue = Int - case reasonUnknown // = 0 +enum Securegcm_InvocationReason: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case reasonUnknown = 0 /// First run of the software package invoking this call - case reasonInitialization // = 1 + case reasonInitialization = 1 /// Ordinary periodic actions (e.g. monthly master key rotation) - case reasonPeriodic // = 2 + case reasonPeriodic = 2 /// Slow-cycle periodic action (e.g. yearly keypair rotation???) - case reasonSlowPeriodic // = 3 + case reasonSlowPeriodic = 3 /// Fast-cycle periodic action (e.g. daily sync for Smart Lock users) - case reasonFastPeriodic // = 4 + case reasonFastPeriodic = 4 /// Expired state (e.g. expired credentials, or cached entries) was detected - case reasonExpiration // = 5 + case reasonExpiration = 5 /// An unexpected protocol failure occurred (so attempting to repair state) - case reasonFailureRecovery // = 6 + case reasonFailureRecovery = 6 /// A new account has been added to the device - case reasonNewAccount // = 7 + case reasonNewAccount = 7 /// An existing account on the device has been changed - case reasonChangedAccount // = 8 + case reasonChangedAccount = 8 /// The user toggled the state of a feature (e.g. Smart Lock enabled via BT) - case reasonFeatureToggled // = 9 + case reasonFeatureToggled = 9 /// A "push" from the server caused this action (e.g. a sync tickle) - case reasonServerInitiated // = 10 + case reasonServerInitiated = 10 /// A local address change triggered this (e.g. GCM registration id changed) - case reasonAddressChange // = 11 + case reasonAddressChange = 11 /// A software update has triggered this - case reasonSoftwareUpdate // = 12 + case reasonSoftwareUpdate = 12 /// A manual action by the user triggered this (e.g. commands sent via adb) - case reasonManual // = 13 + case reasonManual = 13 /// A custom key has been invalidated on the device (e.g. screen lock is /// disabled). - case reasonCustomKeyInvalidation // = 14 + case reasonCustomKeyInvalidation = 14 /// Periodic action triggered by auth_proximity - case reasonProximityPeriodic // = 15 + case reasonProximityPeriodic = 15 init() { self = .reasonUnknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .reasonUnknown - case 1: self = .reasonInitialization - case 2: self = .reasonPeriodic - case 3: self = .reasonSlowPeriodic - case 4: self = .reasonFastPeriodic - case 5: self = .reasonExpiration - case 6: self = .reasonFailureRecovery - case 7: self = .reasonNewAccount - case 8: self = .reasonChangedAccount - case 9: self = .reasonFeatureToggled - case 10: self = .reasonServerInitiated - case 11: self = .reasonAddressChange - case 12: self = .reasonSoftwareUpdate - case 13: self = .reasonManual - case 14: self = .reasonCustomKeyInvalidation - case 15: self = .reasonProximityPeriodic - default: return nil - } - } - - var rawValue: Int { - switch self { - case .reasonUnknown: return 0 - case .reasonInitialization: return 1 - case .reasonPeriodic: return 2 - case .reasonSlowPeriodic: return 3 - case .reasonFastPeriodic: return 4 - case .reasonExpiration: return 5 - case .reasonFailureRecovery: return 6 - case .reasonNewAccount: return 7 - case .reasonChangedAccount: return 8 - case .reasonFeatureToggled: return 9 - case .reasonServerInitiated: return 10 - case .reasonAddressChange: return 11 - case .reasonSoftwareUpdate: return 12 - case .reasonManual: return 13 - case .reasonCustomKeyInvalidation: return 14 - case .reasonProximityPeriodic: return 15 - } - } - -} - -#if swift(>=4.2) - -extension Securegcm_InvocationReason: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - -enum Securegcm_Type: SwiftProtobuf.Enum { - typealias RawValue = Int - case enrollment // = 0 - case tickle // = 1 - case txRequest // = 2 - case txReply // = 3 - case txSyncRequest // = 4 - case txSyncResponse // = 5 - case txPing // = 6 - case deviceInfoUpdate // = 7 - case txCancelRequest // = 8 +enum Securegcm_Type: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case enrollment = 0 + case tickle = 1 + case txRequest = 2 + case txReply = 3 + case txSyncRequest = 4 + case txSyncResponse = 5 + case txPing = 6 + case deviceInfoUpdate = 7 + case txCancelRequest = 8 /// DEPRECATED (can be re-used after Aug 2015) - case proximityauthPairing // = 10 + case proximityauthPairing = 10 /// The kind of identity assertion generated by a "GCM V1" device (i.e., /// an Android phone that has registered with us a public and a symmetric /// key) - case gcmv1IdentityAssertion // = 11 + case gcmv1IdentityAssertion = 11 /// Device-to-device communications are protected by an unauthenticated /// Diffie-Hellman exchange. The InitiatorHello message is simply the @@ -318,87 +176,36 @@ enum Securegcm_Type: SwiftProtobuf.Enum { /// by the derived shared key. It also contains the responder's /// public DH key. ResponderHelloAndPayload messages have the /// DEVICE_TO_DEVICE_RESPONDER_HELLO tag. - case deviceToDeviceResponderHelloPayload // = 12 + case deviceToDeviceResponderHelloPayload = 12 /// Device-to-device communications are protected by an unauthenticated /// Diffie-Hellman exchange. Once the initiator and responder /// agree on a shared key (through Diffie-Hellman), they will use messages /// tagged with DEVICE_TO_DEVICE_MESSAGE to exchange data. - case deviceToDeviceMessage // = 13 + case deviceToDeviceMessage = 13 /// Notification to let a device know it should contact a nearby device. - case deviceProximityCallback // = 14 + case deviceProximityCallback = 14 /// Device-to-device communications are protected by an unauthenticated /// Diffie-Hellman exchange. During device-to-device authentication, the first /// message from initiator (the challenge) is signed and put into the payload /// of the message sent back to the initiator. - case unlockKeySignedChallenge // = 15 + case unlockKeySignedChallenge = 15 /// Specialty (corp only) features - case loginNotification // = 101 + case loginNotification = 101 init() { self = .enrollment } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .enrollment - case 1: self = .tickle - case 2: self = .txRequest - case 3: self = .txReply - case 4: self = .txSyncRequest - case 5: self = .txSyncResponse - case 6: self = .txPing - case 7: self = .deviceInfoUpdate - case 8: self = .txCancelRequest - case 10: self = .proximityauthPairing - case 11: self = .gcmv1IdentityAssertion - case 12: self = .deviceToDeviceResponderHelloPayload - case 13: self = .deviceToDeviceMessage - case 14: self = .deviceProximityCallback - case 15: self = .unlockKeySignedChallenge - case 101: self = .loginNotification - default: return nil - } - } - - var rawValue: Int { - switch self { - case .enrollment: return 0 - case .tickle: return 1 - case .txRequest: return 2 - case .txReply: return 3 - case .txSyncRequest: return 4 - case .txSyncResponse: return 5 - case .txPing: return 6 - case .deviceInfoUpdate: return 7 - case .txCancelRequest: return 8 - case .proximityauthPairing: return 10 - case .gcmv1IdentityAssertion: return 11 - case .deviceToDeviceResponderHelloPayload: return 12 - case .deviceToDeviceMessage: return 13 - case .deviceProximityCallback: return 14 - case .unlockKeySignedChallenge: return 15 - case .loginNotification: return 101 - } - } - -} - -#if swift(>=4.2) - -extension Securegcm_Type: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// Message used only during enrollment /// Field numbers should be kept in sync with DeviceInfo in: /// java/com/google/security/cryptauth/backend/services/common/common.proto -struct Securegcm_GcmDeviceInfo { +nonisolated struct Securegcm_GcmDeviceInfo: @unchecked Sendable { // 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. @@ -407,342 +214,342 @@ struct Securegcm_GcmDeviceInfo { /// Consider using long_device_id and device_type instead when enrolling /// non-android devices. var androidDeviceID: UInt64 { - get {return _storage._androidDeviceID ?? 0} + get {_storage._androidDeviceID ?? 0} set {_uniqueStorage()._androidDeviceID = newValue} } /// Returns true if `androidDeviceID` has been explicitly set. - var hasAndroidDeviceID: Bool {return _storage._androidDeviceID != nil} + var hasAndroidDeviceID: Bool {_storage._androidDeviceID != nil} /// Clears the value of `androidDeviceID`. Subsequent reads from it will return its default value. mutating func clearAndroidDeviceID() {_uniqueStorage()._androidDeviceID = nil} /// Used for device_address of DeviceInfo field 2, but for GCM capable devices. var gcmRegistrationID: Data { - get {return _storage._gcmRegistrationID ?? Data()} + get {_storage._gcmRegistrationID ?? Data()} set {_uniqueStorage()._gcmRegistrationID = newValue} } /// Returns true if `gcmRegistrationID` has been explicitly set. - var hasGcmRegistrationID: Bool {return _storage._gcmRegistrationID != nil} + var hasGcmRegistrationID: Bool {_storage._gcmRegistrationID != nil} /// Clears the value of `gcmRegistrationID`. Subsequent reads from it will return its default value. mutating func clearGcmRegistrationID() {_uniqueStorage()._gcmRegistrationID = nil} /// Used for device_address of DeviceInfo field 2, but for iOS devices. var apnRegistrationID: Data { - get {return _storage._apnRegistrationID ?? Data()} + get {_storage._apnRegistrationID ?? Data()} set {_uniqueStorage()._apnRegistrationID = newValue} } /// Returns true if `apnRegistrationID` has been explicitly set. - var hasApnRegistrationID: Bool {return _storage._apnRegistrationID != nil} + var hasApnRegistrationID: Bool {_storage._apnRegistrationID != nil} /// Clears the value of `apnRegistrationID`. Subsequent reads from it will return its default value. mutating func clearApnRegistrationID() {_uniqueStorage()._apnRegistrationID = nil} /// Does the user have notifications enabled for the given device address. var notificationEnabled: Bool { - get {return _storage._notificationEnabled ?? true} + get {_storage._notificationEnabled ?? true} set {_uniqueStorage()._notificationEnabled = newValue} } /// Returns true if `notificationEnabled` has been explicitly set. - var hasNotificationEnabled: Bool {return _storage._notificationEnabled != nil} + var hasNotificationEnabled: Bool {_storage._notificationEnabled != nil} /// Clears the value of `notificationEnabled`. Subsequent reads from it will return its default value. mutating func clearNotificationEnabled() {_uniqueStorage()._notificationEnabled = nil} /// Used for device_address of DeviceInfo field 2, a Bluetooth Mac address for /// the device (e.g., to be used with EasyUnlock) var bluetoothMacAddress: String { - get {return _storage._bluetoothMacAddress ?? String()} + get {_storage._bluetoothMacAddress ?? String()} set {_uniqueStorage()._bluetoothMacAddress = newValue} } /// Returns true if `bluetoothMacAddress` has been explicitly set. - var hasBluetoothMacAddress: Bool {return _storage._bluetoothMacAddress != nil} + var hasBluetoothMacAddress: Bool {_storage._bluetoothMacAddress != nil} /// Clears the value of `bluetoothMacAddress`. Subsequent reads from it will return its default value. mutating func clearBluetoothMacAddress() {_uniqueStorage()._bluetoothMacAddress = nil} /// SHA-256 hash of the device master key (from the key exchange). /// Differs from DeviceInfo field 3, which contains the actual master key. var deviceMasterKeyHash: Data { - get {return _storage._deviceMasterKeyHash ?? Data()} + get {_storage._deviceMasterKeyHash ?? Data()} set {_uniqueStorage()._deviceMasterKeyHash = newValue} } /// Returns true if `deviceMasterKeyHash` has been explicitly set. - var hasDeviceMasterKeyHash: Bool {return _storage._deviceMasterKeyHash != nil} + var hasDeviceMasterKeyHash: Bool {_storage._deviceMasterKeyHash != nil} /// Clears the value of `deviceMasterKeyHash`. Subsequent reads from it will return its default value. mutating func clearDeviceMasterKeyHash() {_uniqueStorage()._deviceMasterKeyHash = nil} /// A SecureMessage.EcP256PublicKey var userPublicKey: Data { - get {return _storage._userPublicKey ?? Data()} + get {_storage._userPublicKey ?? Data()} set {_uniqueStorage()._userPublicKey = newValue} } /// Returns true if `userPublicKey` has been explicitly set. - var hasUserPublicKey: Bool {return _storage._userPublicKey != nil} + var hasUserPublicKey: Bool {_storage._userPublicKey != nil} /// Clears the value of `userPublicKey`. Subsequent reads from it will return its default value. mutating func clearUserPublicKey() {_uniqueStorage()._userPublicKey = nil} /// device's model name /// (e.g., an android.os.Build.MODEL or UIDevice.model) var deviceModel: String { - get {return _storage._deviceModel ?? String()} + get {_storage._deviceModel ?? String()} set {_uniqueStorage()._deviceModel = newValue} } /// Returns true if `deviceModel` has been explicitly set. - var hasDeviceModel: Bool {return _storage._deviceModel != nil} + var hasDeviceModel: Bool {_storage._deviceModel != nil} /// Clears the value of `deviceModel`. Subsequent reads from it will return its default value. mutating func clearDeviceModel() {_uniqueStorage()._deviceModel = nil} /// device's locale var locale: String { - get {return _storage._locale ?? String()} + get {_storage._locale ?? String()} set {_uniqueStorage()._locale = newValue} } /// Returns true if `locale` has been explicitly set. - var hasLocale: Bool {return _storage._locale != nil} + var hasLocale: Bool {_storage._locale != nil} /// Clears the value of `locale`. Subsequent reads from it will return its default value. mutating func clearLocale() {_uniqueStorage()._locale = nil} /// The handle for user_public_key (and implicitly, a master key) var keyHandle: Data { - get {return _storage._keyHandle ?? Data()} + get {_storage._keyHandle ?? Data()} set {_uniqueStorage()._keyHandle = newValue} } /// Returns true if `keyHandle` has been explicitly set. - var hasKeyHandle: Bool {return _storage._keyHandle != nil} + var hasKeyHandle: Bool {_storage._keyHandle != nil} /// Clears the value of `keyHandle`. Subsequent reads from it will return its default value. mutating func clearKeyHandle() {_uniqueStorage()._keyHandle = nil} /// The initial counter value for the device, sent by the device var counter: Int64 { - get {return _storage._counter ?? 0} + get {_storage._counter ?? 0} set {_uniqueStorage()._counter = newValue} } /// Returns true if `counter` has been explicitly set. - var hasCounter: Bool {return _storage._counter != nil} + var hasCounter: Bool {_storage._counter != nil} /// Clears the value of `counter`. Subsequent reads from it will return its default value. mutating func clearCounter() {_uniqueStorage()._counter = nil} /// The Operating System version on the device /// (e.g., an android.os.Build.DISPLAY or UIDevice.systemVersion) var deviceOsVersion: String { - get {return _storage._deviceOsVersion ?? String()} + get {_storage._deviceOsVersion ?? String()} set {_uniqueStorage()._deviceOsVersion = newValue} } /// Returns true if `deviceOsVersion` has been explicitly set. - var hasDeviceOsVersion: Bool {return _storage._deviceOsVersion != nil} + var hasDeviceOsVersion: Bool {_storage._deviceOsVersion != nil} /// Clears the value of `deviceOsVersion`. Subsequent reads from it will return its default value. mutating func clearDeviceOsVersion() {_uniqueStorage()._deviceOsVersion = nil} /// The Operating System version number on the device /// (e.g., an android.os.Build.VERSION.SDK_INT) var deviceOsVersionCode: Int64 { - get {return _storage._deviceOsVersionCode ?? 0} + get {_storage._deviceOsVersionCode ?? 0} set {_uniqueStorage()._deviceOsVersionCode = newValue} } /// Returns true if `deviceOsVersionCode` has been explicitly set. - var hasDeviceOsVersionCode: Bool {return _storage._deviceOsVersionCode != nil} + var hasDeviceOsVersionCode: Bool {_storage._deviceOsVersionCode != nil} /// Clears the value of `deviceOsVersionCode`. Subsequent reads from it will return its default value. mutating func clearDeviceOsVersionCode() {_uniqueStorage()._deviceOsVersionCode = nil} /// The Operating System release on the device /// (e.g., an android.os.Build.VERSION.RELEASE) var deviceOsRelease: String { - get {return _storage._deviceOsRelease ?? String()} + get {_storage._deviceOsRelease ?? String()} set {_uniqueStorage()._deviceOsRelease = newValue} } /// Returns true if `deviceOsRelease` has been explicitly set. - var hasDeviceOsRelease: Bool {return _storage._deviceOsRelease != nil} + var hasDeviceOsRelease: Bool {_storage._deviceOsRelease != nil} /// Clears the value of `deviceOsRelease`. Subsequent reads from it will return its default value. mutating func clearDeviceOsRelease() {_uniqueStorage()._deviceOsRelease = nil} /// The Operating System codename on the device /// (e.g., an android.os.Build.VERSION.CODENAME or UIDevice.systemName) var deviceOsCodename: String { - get {return _storage._deviceOsCodename ?? String()} + get {_storage._deviceOsCodename ?? String()} set {_uniqueStorage()._deviceOsCodename = newValue} } /// Returns true if `deviceOsCodename` has been explicitly set. - var hasDeviceOsCodename: Bool {return _storage._deviceOsCodename != nil} + var hasDeviceOsCodename: Bool {_storage._deviceOsCodename != nil} /// Clears the value of `deviceOsCodename`. Subsequent reads from it will return its default value. mutating func clearDeviceOsCodename() {_uniqueStorage()._deviceOsCodename = nil} /// The software version running on the device /// (e.g., Authenticator app version string) var deviceSoftwareVersion: String { - get {return _storage._deviceSoftwareVersion ?? String()} + get {_storage._deviceSoftwareVersion ?? String()} set {_uniqueStorage()._deviceSoftwareVersion = newValue} } /// Returns true if `deviceSoftwareVersion` has been explicitly set. - var hasDeviceSoftwareVersion: Bool {return _storage._deviceSoftwareVersion != nil} + var hasDeviceSoftwareVersion: Bool {_storage._deviceSoftwareVersion != nil} /// Clears the value of `deviceSoftwareVersion`. Subsequent reads from it will return its default value. mutating func clearDeviceSoftwareVersion() {_uniqueStorage()._deviceSoftwareVersion = nil} /// The software version number running on the device /// (e.g., Authenticator app version code) var deviceSoftwareVersionCode: Int64 { - get {return _storage._deviceSoftwareVersionCode ?? 0} + get {_storage._deviceSoftwareVersionCode ?? 0} set {_uniqueStorage()._deviceSoftwareVersionCode = newValue} } /// Returns true if `deviceSoftwareVersionCode` has been explicitly set. - var hasDeviceSoftwareVersionCode: Bool {return _storage._deviceSoftwareVersionCode != nil} + var hasDeviceSoftwareVersionCode: Bool {_storage._deviceSoftwareVersionCode != nil} /// Clears the value of `deviceSoftwareVersionCode`. Subsequent reads from it will return its default value. mutating func clearDeviceSoftwareVersionCode() {_uniqueStorage()._deviceSoftwareVersionCode = nil} /// Software package information if applicable /// (e.g., com.google.android.apps.authenticator2) var deviceSoftwarePackage: String { - get {return _storage._deviceSoftwarePackage ?? String()} + get {_storage._deviceSoftwarePackage ?? String()} set {_uniqueStorage()._deviceSoftwarePackage = newValue} } /// Returns true if `deviceSoftwarePackage` has been explicitly set. - var hasDeviceSoftwarePackage: Bool {return _storage._deviceSoftwarePackage != nil} + var hasDeviceSoftwarePackage: Bool {_storage._deviceSoftwarePackage != nil} /// Clears the value of `deviceSoftwarePackage`. Subsequent reads from it will return its default value. mutating func clearDeviceSoftwarePackage() {_uniqueStorage()._deviceSoftwarePackage = nil} /// Size of the display in thousandths of an inch (e.g., 7000 mils = 7 in) var deviceDisplayDiagonalMils: Int32 { - get {return _storage._deviceDisplayDiagonalMils ?? 0} + get {_storage._deviceDisplayDiagonalMils ?? 0} set {_uniqueStorage()._deviceDisplayDiagonalMils = newValue} } /// Returns true if `deviceDisplayDiagonalMils` has been explicitly set. - var hasDeviceDisplayDiagonalMils: Bool {return _storage._deviceDisplayDiagonalMils != nil} + var hasDeviceDisplayDiagonalMils: Bool {_storage._deviceDisplayDiagonalMils != nil} /// Clears the value of `deviceDisplayDiagonalMils`. Subsequent reads from it will return its default value. mutating func clearDeviceDisplayDiagonalMils() {_uniqueStorage()._deviceDisplayDiagonalMils = nil} /// For Authzen capable devices, their Authzen protocol version var deviceAuthzenVersion: Int32 { - get {return _storage._deviceAuthzenVersion ?? 0} + get {_storage._deviceAuthzenVersion ?? 0} set {_uniqueStorage()._deviceAuthzenVersion = newValue} } /// Returns true if `deviceAuthzenVersion` has been explicitly set. - var hasDeviceAuthzenVersion: Bool {return _storage._deviceAuthzenVersion != nil} + var hasDeviceAuthzenVersion: Bool {_storage._deviceAuthzenVersion != nil} /// Clears the value of `deviceAuthzenVersion`. Subsequent reads from it will return its default value. mutating func clearDeviceAuthzenVersion() {_uniqueStorage()._deviceAuthzenVersion = nil} /// Not all devices have device identifiers that fit in 64 bits. var longDeviceID: Data { - get {return _storage._longDeviceID ?? Data()} + get {_storage._longDeviceID ?? Data()} set {_uniqueStorage()._longDeviceID = newValue} } /// Returns true if `longDeviceID` has been explicitly set. - var hasLongDeviceID: Bool {return _storage._longDeviceID != nil} + var hasLongDeviceID: Bool {_storage._longDeviceID != nil} /// Clears the value of `longDeviceID`. Subsequent reads from it will return its default value. mutating func clearLongDeviceID() {_uniqueStorage()._longDeviceID = nil} /// The device manufacturer name /// (e.g., android.os.Build.MANUFACTURER) var deviceManufacturer: String { - get {return _storage._deviceManufacturer ?? String()} + get {_storage._deviceManufacturer ?? String()} set {_uniqueStorage()._deviceManufacturer = newValue} } /// Returns true if `deviceManufacturer` has been explicitly set. - var hasDeviceManufacturer: Bool {return _storage._deviceManufacturer != nil} + var hasDeviceManufacturer: Bool {_storage._deviceManufacturer != nil} /// Clears the value of `deviceManufacturer`. Subsequent reads from it will return its default value. mutating func clearDeviceManufacturer() {_uniqueStorage()._deviceManufacturer = nil} /// Used to indicate which type of device this is. var deviceType: Securegcm_DeviceType { - get {return _storage._deviceType ?? .android} + get {_storage._deviceType ?? .android} set {_uniqueStorage()._deviceType = newValue} } /// Returns true if `deviceType` has been explicitly set. - var hasDeviceType: Bool {return _storage._deviceType != nil} + var hasDeviceType: Bool {_storage._deviceType != nil} /// Clears the value of `deviceType`. Subsequent reads from it will return its default value. mutating func clearDeviceType() {_uniqueStorage()._deviceType = nil} /// Is this device using a secure screenlock (e.g., pattern or pin unlock) var usingSecureScreenlock: Bool { - get {return _storage._usingSecureScreenlock ?? false} + get {_storage._usingSecureScreenlock ?? false} set {_uniqueStorage()._usingSecureScreenlock = newValue} } /// Returns true if `usingSecureScreenlock` has been explicitly set. - var hasUsingSecureScreenlock: Bool {return _storage._usingSecureScreenlock != nil} + var hasUsingSecureScreenlock: Bool {_storage._usingSecureScreenlock != nil} /// Clears the value of `usingSecureScreenlock`. Subsequent reads from it will return its default value. mutating func clearUsingSecureScreenlock() {_uniqueStorage()._usingSecureScreenlock = nil} /// Is auto-unlocking the screenlock (e.g., when at "home") supported? var autoUnlockScreenlockSupported: Bool { - get {return _storage._autoUnlockScreenlockSupported ?? false} + get {_storage._autoUnlockScreenlockSupported ?? false} set {_uniqueStorage()._autoUnlockScreenlockSupported = newValue} } /// Returns true if `autoUnlockScreenlockSupported` has been explicitly set. - var hasAutoUnlockScreenlockSupported: Bool {return _storage._autoUnlockScreenlockSupported != nil} + var hasAutoUnlockScreenlockSupported: Bool {_storage._autoUnlockScreenlockSupported != nil} /// Clears the value of `autoUnlockScreenlockSupported`. Subsequent reads from it will return its default value. mutating func clearAutoUnlockScreenlockSupported() {_uniqueStorage()._autoUnlockScreenlockSupported = nil} /// Is auto-unlocking the screenlock (e.g., when at "home") enabled? var autoUnlockScreenlockEnabled: Bool { - get {return _storage._autoUnlockScreenlockEnabled ?? false} + get {_storage._autoUnlockScreenlockEnabled ?? false} set {_uniqueStorage()._autoUnlockScreenlockEnabled = newValue} } /// Returns true if `autoUnlockScreenlockEnabled` has been explicitly set. - var hasAutoUnlockScreenlockEnabled: Bool {return _storage._autoUnlockScreenlockEnabled != nil} + var hasAutoUnlockScreenlockEnabled: Bool {_storage._autoUnlockScreenlockEnabled != nil} /// Clears the value of `autoUnlockScreenlockEnabled`. Subsequent reads from it will return its default value. mutating func clearAutoUnlockScreenlockEnabled() {_uniqueStorage()._autoUnlockScreenlockEnabled = nil} /// Does the device have a Bluetooth (classic) radio? var bluetoothRadioSupported: Bool { - get {return _storage._bluetoothRadioSupported ?? false} + get {_storage._bluetoothRadioSupported ?? false} set {_uniqueStorage()._bluetoothRadioSupported = newValue} } /// Returns true if `bluetoothRadioSupported` has been explicitly set. - var hasBluetoothRadioSupported: Bool {return _storage._bluetoothRadioSupported != nil} + var hasBluetoothRadioSupported: Bool {_storage._bluetoothRadioSupported != nil} /// Clears the value of `bluetoothRadioSupported`. Subsequent reads from it will return its default value. mutating func clearBluetoothRadioSupported() {_uniqueStorage()._bluetoothRadioSupported = nil} /// Is the Bluetooth (classic) radio on? var bluetoothRadioEnabled: Bool { - get {return _storage._bluetoothRadioEnabled ?? false} + get {_storage._bluetoothRadioEnabled ?? false} set {_uniqueStorage()._bluetoothRadioEnabled = newValue} } /// Returns true if `bluetoothRadioEnabled` has been explicitly set. - var hasBluetoothRadioEnabled: Bool {return _storage._bluetoothRadioEnabled != nil} + var hasBluetoothRadioEnabled: Bool {_storage._bluetoothRadioEnabled != nil} /// Clears the value of `bluetoothRadioEnabled`. Subsequent reads from it will return its default value. mutating func clearBluetoothRadioEnabled() {_uniqueStorage()._bluetoothRadioEnabled = nil} /// Does the device hardware support a mobile data connection? var mobileDataSupported: Bool { - get {return _storage._mobileDataSupported ?? false} + get {_storage._mobileDataSupported ?? false} set {_uniqueStorage()._mobileDataSupported = newValue} } /// Returns true if `mobileDataSupported` has been explicitly set. - var hasMobileDataSupported: Bool {return _storage._mobileDataSupported != nil} + var hasMobileDataSupported: Bool {_storage._mobileDataSupported != nil} /// Clears the value of `mobileDataSupported`. Subsequent reads from it will return its default value. mutating func clearMobileDataSupported() {_uniqueStorage()._mobileDataSupported = nil} /// Does the device support tethering? var tetheringSupported: Bool { - get {return _storage._tetheringSupported ?? false} + get {_storage._tetheringSupported ?? false} set {_uniqueStorage()._tetheringSupported = newValue} } /// Returns true if `tetheringSupported` has been explicitly set. - var hasTetheringSupported: Bool {return _storage._tetheringSupported != nil} + var hasTetheringSupported: Bool {_storage._tetheringSupported != nil} /// Clears the value of `tetheringSupported`. Subsequent reads from it will return its default value. mutating func clearTetheringSupported() {_uniqueStorage()._tetheringSupported = nil} /// Does the device have a BLE radio? var bleRadioSupported: Bool { - get {return _storage._bleRadioSupported ?? false} + get {_storage._bleRadioSupported ?? false} set {_uniqueStorage()._bleRadioSupported = newValue} } /// Returns true if `bleRadioSupported` has been explicitly set. - var hasBleRadioSupported: Bool {return _storage._bleRadioSupported != nil} + var hasBleRadioSupported: Bool {_storage._bleRadioSupported != nil} /// Clears the value of `bleRadioSupported`. Subsequent reads from it will return its default value. mutating func clearBleRadioSupported() {_uniqueStorage()._bleRadioSupported = nil} /// Is the device a "Pixel Experience" Android device? var pixelExperience: Bool { - get {return _storage._pixelExperience ?? false} + get {_storage._pixelExperience ?? false} set {_uniqueStorage()._pixelExperience = newValue} } /// Returns true if `pixelExperience` has been explicitly set. - var hasPixelExperience: Bool {return _storage._pixelExperience != nil} + var hasPixelExperience: Bool {_storage._pixelExperience != nil} /// Clears the value of `pixelExperience`. Subsequent reads from it will return its default value. mutating func clearPixelExperience() {_uniqueStorage()._pixelExperience = nil} /// Is the device running in the ARC++ container on a chromebook? var arcPlusPlus: Bool { - get {return _storage._arcPlusPlus ?? false} + get {_storage._arcPlusPlus ?? false} set {_uniqueStorage()._arcPlusPlus = newValue} } /// Returns true if `arcPlusPlus` has been explicitly set. - var hasArcPlusPlus: Bool {return _storage._arcPlusPlus != nil} + var hasArcPlusPlus: Bool {_storage._arcPlusPlus != nil} /// Clears the value of `arcPlusPlus`. Subsequent reads from it will return its default value. mutating func clearArcPlusPlus() {_uniqueStorage()._arcPlusPlus = nil} @@ -750,44 +557,44 @@ struct Securegcm_GcmDeviceInfo { /// devices, the platform API to get the screenlock state is not trustworthy. /// See b/32212161. var isScreenlockStateFlaky: Bool { - get {return _storage._isScreenlockStateFlaky ?? false} + get {_storage._isScreenlockStateFlaky ?? false} set {_uniqueStorage()._isScreenlockStateFlaky = newValue} } /// Returns true if `isScreenlockStateFlaky` has been explicitly set. - var hasIsScreenlockStateFlaky: Bool {return _storage._isScreenlockStateFlaky != nil} + var hasIsScreenlockStateFlaky: Bool {_storage._isScreenlockStateFlaky != nil} /// Clears the value of `isScreenlockStateFlaky`. Subsequent reads from it will return its default value. mutating func clearIsScreenlockStateFlaky() {_uniqueStorage()._isScreenlockStateFlaky = nil} /// A list of multi-device software features supported by the device. var supportedSoftwareFeatures: [Securegcm_SoftwareFeature] { - get {return _storage._supportedSoftwareFeatures} + get {_storage._supportedSoftwareFeatures} set {_uniqueStorage()._supportedSoftwareFeatures = newValue} } /// A list of multi-device software features currently enabled (active) on the /// device. var enabledSoftwareFeatures: [Securegcm_SoftwareFeature] { - get {return _storage._enabledSoftwareFeatures} + get {_storage._enabledSoftwareFeatures} set {_uniqueStorage()._enabledSoftwareFeatures = newValue} } /// The enrollment session id this is sent with var enrollmentSessionID: Data { - get {return _storage._enrollmentSessionID ?? Data()} + get {_storage._enrollmentSessionID ?? Data()} set {_uniqueStorage()._enrollmentSessionID = newValue} } /// Returns true if `enrollmentSessionID` has been explicitly set. - var hasEnrollmentSessionID: Bool {return _storage._enrollmentSessionID != nil} + var hasEnrollmentSessionID: Bool {_storage._enrollmentSessionID != nil} /// Clears the value of `enrollmentSessionID`. Subsequent reads from it will return its default value. mutating func clearEnrollmentSessionID() {_uniqueStorage()._enrollmentSessionID = nil} /// A copy of the user's OAuth token var oauthToken: String { - get {return _storage._oauthToken ?? String()} + get {_storage._oauthToken ?? String()} set {_uniqueStorage()._oauthToken = newValue} } /// Returns true if `oauthToken` has been explicitly set. - var hasOauthToken: Bool {return _storage._oauthToken != nil} + var hasOauthToken: Bool {_storage._oauthToken != nil} /// Clears the value of `oauthToken`. Subsequent reads from it will return its default value. mutating func clearOauthToken() {_uniqueStorage()._oauthToken = nil} @@ -798,26 +605,26 @@ struct Securegcm_GcmDeviceInfo { fileprivate var _storage = _StorageClass.defaultInstance } -struct Securegcm_GcmMetadata { +nonisolated struct Securegcm_GcmMetadata: Sendable { // 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 type: Securegcm_Type { - get {return _type ?? .enrollment} + get {_type ?? .enrollment} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} var version: Int32 { - get {return _version ?? 0} + get {_version ?? 0} set {_version = newValue} } /// Returns true if `version` has been explicitly set. - var hasVersion: Bool {return self._version != nil} + var hasVersion: Bool {self._version != nil} /// Clears the value of `version`. Subsequent reads from it will return its default value. mutating func clearVersion() {self._version = nil} @@ -829,18 +636,18 @@ struct Securegcm_GcmMetadata { fileprivate var _version: Int32? = nil } -struct Securegcm_Tickle { +nonisolated struct Securegcm_Tickle: Sendable { // 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. /// Time after which this tickle should expire var expiryTime: UInt64 { - get {return _expiryTime ?? 0} + get {_expiryTime ?? 0} set {_expiryTime = newValue} } /// Returns true if `expiryTime` has been explicitly set. - var hasExpiryTime: Bool {return self._expiryTime != nil} + var hasExpiryTime: Bool {self._expiryTime != nil} /// Clears the value of `expiryTime`. Subsequent reads from it will return its default value. mutating func clearExpiryTime() {self._expiryTime = nil} @@ -851,58 +658,58 @@ struct Securegcm_Tickle { fileprivate var _expiryTime: UInt64? = nil } -struct Securegcm_LoginNotificationInfo { +nonisolated struct Securegcm_LoginNotificationInfo: Sendable { // 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. /// Time at which the server received the login notification request. var creationTime: UInt64 { - get {return _creationTime ?? 0} + get {_creationTime ?? 0} set {_creationTime = newValue} } /// Returns true if `creationTime` has been explicitly set. - var hasCreationTime: Bool {return self._creationTime != nil} + var hasCreationTime: Bool {self._creationTime != nil} /// Clears the value of `creationTime`. Subsequent reads from it will return its default value. mutating func clearCreationTime() {self._creationTime = nil} /// Must correspond to user_id in LoginNotificationRequest, if set. var email: String { - get {return _email ?? String()} + get {_email ?? String()} set {_email = newValue} } /// Returns true if `email` has been explicitly set. - var hasEmail: Bool {return self._email != nil} + var hasEmail: Bool {self._email != nil} /// Clears the value of `email`. Subsequent reads from it will return its default value. mutating func clearEmail() {self._email = nil} /// Host where the user's credentials were used to login, if meaningful. var host: String { - get {return _host ?? String()} + get {_host ?? String()} set {_host = newValue} } /// Returns true if `host` has been explicitly set. - var hasHost: Bool {return self._host != nil} + var hasHost: Bool {self._host != nil} /// Clears the value of `host`. Subsequent reads from it will return its default value. mutating func clearHost() {self._host = nil} /// Location from where the user's credentials were used, if meaningful. var source: String { - get {return _source ?? String()} + get {_source ?? String()} set {_source = newValue} } /// Returns true if `source` has been explicitly set. - var hasSource: Bool {return self._source != nil} + var hasSource: Bool {self._source != nil} /// Clears the value of `source`. Subsequent reads from it will return its default value. mutating func clearSource() {self._source = nil} /// Type of login, e.g. ssh, gnome-screensaver, or web. var eventType: String { - get {return _eventType ?? String()} + get {_eventType ?? String()} set {_eventType = newValue} } /// Returns true if `eventType` has been explicitly set. - var hasEventType: Bool {return self._eventType != nil} + var hasEventType: Bool {self._eventType != nil} /// Clears the value of `eventType`. Subsequent reads from it will return its default value. mutating func clearEventType() {self._eventType = nil} @@ -917,138 +724,33 @@ struct Securegcm_LoginNotificationInfo { fileprivate var _eventType: String? = nil } -#if swift(>=5.5) && canImport(_Concurrency) -extension Securegcm_AppleDeviceDiagonalMils: @unchecked Sendable {} -extension Securegcm_DeviceType: @unchecked Sendable {} -extension Securegcm_SoftwareFeature: @unchecked Sendable {} -extension Securegcm_InvocationReason: @unchecked Sendable {} -extension Securegcm_Type: @unchecked Sendable {} -extension Securegcm_GcmDeviceInfo: @unchecked Sendable {} -extension Securegcm_GcmMetadata: @unchecked Sendable {} -extension Securegcm_Tickle: @unchecked Sendable {} -extension Securegcm_LoginNotificationInfo: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "securegcm" +nonisolated fileprivate let _protobuf_package = "securegcm" -extension Securegcm_AppleDeviceDiagonalMils: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 4000: .same(proto: "APPLE_PHONE"), - 7900: .same(proto: "APPLE_PAD"), - ] +nonisolated extension Securegcm_AppleDeviceDiagonalMils: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}`>APPLE_PHONE\0\u{2}|(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1461,15 +1162,9 @@ extension Securegcm_Tickle: @preconcurrency SwiftProtobuf.Message, @preconcurren } } -extension Securegcm_LoginNotificationInfo: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_LoginNotificationInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LoginNotificationInfo" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .standard(proto: "creation_time"), - 3: .same(proto: "email"), - 4: .same(proto: "host"), - 5: .same(proto: "source"), - 6: .standard(proto: "event_type"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}\u{2}creation_time\0\u{1}email\0\u{1}host\0\u{1}source\0\u{3}event_type\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { diff --git a/airsync-mac/Core/QuickShare/Protobuf/securemessage.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/securemessage.pb.swift index a3ec5e27..d294ed21 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/securemessage.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/securemessage.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: securemessage.proto @@ -23,7 +24,11 @@ // Proto definitions for SecureMessage format +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif @preconcurrency import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -32,149 +37,73 @@ import Foundation // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// Supported "signature" schemes (both symmetric key and public key based) -enum Securemessage_SigScheme: SwiftProtobuf.Enum { - typealias RawValue = Int - case hmacSha256 // = 1 - case ecdsaP256Sha256 // = 2 +enum Securemessage_SigScheme: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case hmacSha256 = 1 + case ecdsaP256Sha256 = 2 /// Not recommended -- use ECDSA_P256_SHA256 instead - case rsa2048Sha256 // = 3 + case rsa2048Sha256 = 3 init() { self = .hmacSha256 } - init?(rawValue: Int) { - switch rawValue { - case 1: self = .hmacSha256 - case 2: self = .ecdsaP256Sha256 - case 3: self = .rsa2048Sha256 - default: return nil - } - } - - var rawValue: Int { - switch self { - case .hmacSha256: return 1 - case .ecdsaP256Sha256: return 2 - case .rsa2048Sha256: return 3 - } - } - -} - -#if swift(>=4.2) - -extension Securemessage_SigScheme: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// Supported encryption schemes -enum Securemessage_EncScheme: SwiftProtobuf.Enum { - typealias RawValue = Int +enum Securemessage_EncScheme: Int, SwiftProtobuf.Enum, Swift.CaseIterable { /// No encryption - case none // = 1 - case aes256Cbc // = 2 + case none = 1 + case aes256Cbc = 2 init() { self = .none } - init?(rawValue: Int) { - switch rawValue { - case 1: self = .none - case 2: self = .aes256Cbc - default: return nil - } - } - - var rawValue: Int { - switch self { - case .none: return 1 - case .aes256Cbc: return 2 - } - } - } -#if swift(>=4.2) - -extension Securemessage_EncScheme: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// A list of supported public key types -enum Securemessage_PublicKeyType: SwiftProtobuf.Enum { - typealias RawValue = Int - case ecP256 // = 1 - case rsa2048 // = 2 +enum Securemessage_PublicKeyType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case ecP256 = 1 + case rsa2048 = 2 /// 2048-bit MODP group 14, from RFC 3526 - case dh2048Modp // = 3 + case dh2048Modp = 3 init() { self = .ecP256 } - init?(rawValue: Int) { - switch rawValue { - case 1: self = .ecP256 - case 2: self = .rsa2048 - case 3: self = .dh2048Modp - default: return nil - } - } - - var rawValue: Int { - switch self { - case .ecP256: return 1 - case .rsa2048: return 2 - case .dh2048Modp: return 3 - } - } - } -#if swift(>=4.2) - -extension Securemessage_PublicKeyType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Securemessage_SecureMessage { +nonisolated struct Securemessage_SecureMessage: Sendable { // 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. /// Must contain a HeaderAndBody message var headerAndBody: Data { - get {return _headerAndBody ?? Data()} + get {_headerAndBody ?? Data()} set {_headerAndBody = newValue} } /// Returns true if `headerAndBody` has been explicitly set. - var hasHeaderAndBody: Bool {return self._headerAndBody != nil} + var hasHeaderAndBody: Bool {self._headerAndBody != nil} /// Clears the value of `headerAndBody`. Subsequent reads from it will return its default value. mutating func clearHeaderAndBody() {self._headerAndBody = nil} /// Signature of header_and_body var signature: Data { - get {return _signature ?? Data()} + get {_signature ?? Data()} set {_signature = newValue} } /// Returns true if `signature` has been explicitly set. - var hasSignature: Bool {return self._signature != nil} + var hasSignature: Bool {self._signature != nil} /// Clears the value of `signature`. Subsequent reads from it will return its default value. mutating func clearSignature() {self._signature = nil} @@ -186,77 +115,77 @@ struct Securemessage_SecureMessage { fileprivate var _signature: Data? = nil } -struct Securemessage_Header { +nonisolated struct Securemessage_Header: Sendable { // 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 signatureScheme: Securemessage_SigScheme { - get {return _signatureScheme ?? .hmacSha256} + get {_signatureScheme ?? .hmacSha256} set {_signatureScheme = newValue} } /// Returns true if `signatureScheme` has been explicitly set. - var hasSignatureScheme: Bool {return self._signatureScheme != nil} + var hasSignatureScheme: Bool {self._signatureScheme != nil} /// Clears the value of `signatureScheme`. Subsequent reads from it will return its default value. mutating func clearSignatureScheme() {self._signatureScheme = nil} var encryptionScheme: Securemessage_EncScheme { - get {return _encryptionScheme ?? .none} + get {_encryptionScheme ?? .none} set {_encryptionScheme = newValue} } /// Returns true if `encryptionScheme` has been explicitly set. - var hasEncryptionScheme: Bool {return self._encryptionScheme != nil} + var hasEncryptionScheme: Bool {self._encryptionScheme != nil} /// Clears the value of `encryptionScheme`. Subsequent reads from it will return its default value. mutating func clearEncryptionScheme() {self._encryptionScheme = nil} /// Identifies the verification key var verificationKeyID: Data { - get {return _verificationKeyID ?? Data()} + get {_verificationKeyID ?? Data()} set {_verificationKeyID = newValue} } /// Returns true if `verificationKeyID` has been explicitly set. - var hasVerificationKeyID: Bool {return self._verificationKeyID != nil} + var hasVerificationKeyID: Bool {self._verificationKeyID != nil} /// Clears the value of `verificationKeyID`. Subsequent reads from it will return its default value. mutating func clearVerificationKeyID() {self._verificationKeyID = nil} /// Identifies the decryption key var decryptionKeyID: Data { - get {return _decryptionKeyID ?? Data()} + get {_decryptionKeyID ?? Data()} set {_decryptionKeyID = newValue} } /// Returns true if `decryptionKeyID` has been explicitly set. - var hasDecryptionKeyID: Bool {return self._decryptionKeyID != nil} + var hasDecryptionKeyID: Bool {self._decryptionKeyID != nil} /// Clears the value of `decryptionKeyID`. Subsequent reads from it will return its default value. mutating func clearDecryptionKeyID() {self._decryptionKeyID = nil} /// Encryption may use an IV var iv: Data { - get {return _iv ?? Data()} + get {_iv ?? Data()} set {_iv = newValue} } /// Returns true if `iv` has been explicitly set. - var hasIv: Bool {return self._iv != nil} + var hasIv: Bool {self._iv != nil} /// Clears the value of `iv`. Subsequent reads from it will return its default value. mutating func clearIv() {self._iv = nil} /// Arbitrary per-protocol public data, to be sent with the plain-text header var publicMetadata: Data { - get {return _publicMetadata ?? Data()} + get {_publicMetadata ?? Data()} set {_publicMetadata = newValue} } /// Returns true if `publicMetadata` has been explicitly set. - var hasPublicMetadata: Bool {return self._publicMetadata != nil} + var hasPublicMetadata: Bool {self._publicMetadata != nil} /// Clears the value of `publicMetadata`. Subsequent reads from it will return its default value. mutating func clearPublicMetadata() {self._publicMetadata = nil} /// The length of some associated data this is not sent in this SecureMessage, /// but which will be bound to the signature. var associatedDataLength: UInt32 { - get {return _associatedDataLength ?? 0} + get {_associatedDataLength ?? 0} set {_associatedDataLength = newValue} } /// Returns true if `associatedDataLength` has been explicitly set. - var hasAssociatedDataLength: Bool {return self._associatedDataLength != nil} + var hasAssociatedDataLength: Bool {self._associatedDataLength != nil} /// Clears the value of `associatedDataLength`. Subsequent reads from it will return its default value. mutating func clearAssociatedDataLength() {self._associatedDataLength = nil} @@ -273,28 +202,28 @@ struct Securemessage_Header { fileprivate var _associatedDataLength: UInt32? = nil } -struct Securemessage_HeaderAndBody { +nonisolated struct Securemessage_HeaderAndBody: Sendable { // 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. /// Public data about this message (to be bound in the signature) var header: Securemessage_Header { - get {return _header ?? Securemessage_Header()} + get {_header ?? Securemessage_Header()} set {_header = newValue} } /// Returns true if `header` has been explicitly set. - var hasHeader: Bool {return self._header != nil} + var hasHeader: Bool {self._header != nil} /// Clears the value of `header`. Subsequent reads from it will return its default value. mutating func clearHeader() {self._header = nil} /// Payload data var body: Data { - get {return _body ?? Data()} + get {_body ?? Data()} set {_body = newValue} } /// Returns true if `body` has been explicitly set. - var hasBody: Bool {return self._body != nil} + var hasBody: Bool {self._body != nil} /// Clears the value of `body`. Subsequent reads from it will return its default value. mutating func clearBody() {self._body = nil} @@ -311,28 +240,28 @@ struct Securemessage_HeaderAndBody { /// remains stable irrespective of protobuf implementation choices. This /// low-level representation of a HeaderAndBody should not be used by /// any code outside of the SecureMessage library implementation/tests. -struct Securemessage_HeaderAndBodyInternal { +nonisolated struct Securemessage_HeaderAndBodyInternal: Sendable { // 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. /// A raw (wire-format) byte encoding of a Header, suitable for hashing var header: Data { - get {return _header ?? Data()} + get {_header ?? Data()} set {_header = newValue} } /// Returns true if `header` has been explicitly set. - var hasHeader: Bool {return self._header != nil} + var hasHeader: Bool {self._header != nil} /// Clears the value of `header`. Subsequent reads from it will return its default value. mutating func clearHeader() {self._header = nil} /// Payload data var body: Data { - get {return _body ?? Data()} + get {_body ?? Data()} set {_body = newValue} } /// Returns true if `body` has been explicitly set. - var hasBody: Bool {return self._body != nil} + var hasBody: Bool {self._body != nil} /// Clears the value of `body`. Subsequent reads from it will return its default value. mutating func clearBody() {self._body = nil} @@ -345,7 +274,7 @@ struct Securemessage_HeaderAndBodyInternal { } /// A convenience proto for encoding NIST P-256 elliptic curve public keys -struct Securemessage_EcP256PublicKey { +nonisolated struct Securemessage_EcP256PublicKey: Sendable { // 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. @@ -353,20 +282,20 @@ struct Securemessage_EcP256PublicKey { /// x and y are encoded in big-endian two's complement (slightly wasteful) /// Client MUST verify (x,y) is a valid point on NIST P256 var x: Data { - get {return _x ?? Data()} + get {_x ?? Data()} set {_x = newValue} } /// Returns true if `x` has been explicitly set. - var hasX: Bool {return self._x != nil} + var hasX: Bool {self._x != nil} /// Clears the value of `x`. Subsequent reads from it will return its default value. mutating func clearX() {self._x = nil} var y: Data { - get {return _y ?? Data()} + get {_y ?? Data()} set {_y = newValue} } /// Returns true if `y` has been explicitly set. - var hasY: Bool {return self._y != nil} + var hasY: Bool {self._y != nil} /// Clears the value of `y`. Subsequent reads from it will return its default value. mutating func clearY() {self._y = nil} @@ -379,27 +308,27 @@ struct Securemessage_EcP256PublicKey { } /// A convenience proto for encoding RSA public keys with small exponents -struct Securemessage_SimpleRsaPublicKey { +nonisolated struct Securemessage_SimpleRsaPublicKey: Sendable { // 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. /// Encoded in big-endian two's complement var n: Data { - get {return _n ?? Data()} + get {_n ?? Data()} set {_n = newValue} } /// Returns true if `n` has been explicitly set. - var hasN: Bool {return self._n != nil} + var hasN: Bool {self._n != nil} /// Clears the value of `n`. Subsequent reads from it will return its default value. mutating func clearN() {self._n = nil} var e: Int32 { - get {return _e ?? 65537} + get {_e ?? 65537} set {_e = newValue} } /// Returns true if `e` has been explicitly set. - var hasE: Bool {return self._e != nil} + var hasE: Bool {self._e != nil} /// Clears the value of `e`. Subsequent reads from it will return its default value. mutating func clearE() {self._e = nil} @@ -414,18 +343,18 @@ struct Securemessage_SimpleRsaPublicKey { /// A convenience proto for encoding Diffie-Hellman public keys, /// for use only when Elliptic Curve based key exchanges are not possible. /// (Note that the group parameters must be specified separately) -struct Securemessage_DhPublicKey { +nonisolated struct Securemessage_DhPublicKey: Sendable { // 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. /// Big-endian two's complement encoded group element var y: Data { - get {return _y ?? Data()} + get {_y ?? Data()} set {_y = newValue} } /// Returns true if `y` has been explicitly set. - var hasY: Bool {return self._y != nil} + var hasY: Bool {self._y != nil} /// Clears the value of `y`. Subsequent reads from it will return its default value. mutating func clearY() {self._y = nil} @@ -436,45 +365,45 @@ struct Securemessage_DhPublicKey { fileprivate var _y: Data? = nil } -struct Securemessage_GenericPublicKey { +nonisolated struct Securemessage_GenericPublicKey: Sendable { // 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 type: Securemessage_PublicKeyType { - get {return _type ?? .ecP256} + get {_type ?? .ecP256} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} var ecP256PublicKey: Securemessage_EcP256PublicKey { - get {return _ecP256PublicKey ?? Securemessage_EcP256PublicKey()} + get {_ecP256PublicKey ?? Securemessage_EcP256PublicKey()} set {_ecP256PublicKey = newValue} } /// Returns true if `ecP256PublicKey` has been explicitly set. - var hasEcP256PublicKey: Bool {return self._ecP256PublicKey != nil} + var hasEcP256PublicKey: Bool {self._ecP256PublicKey != nil} /// Clears the value of `ecP256PublicKey`. Subsequent reads from it will return its default value. mutating func clearEcP256PublicKey() {self._ecP256PublicKey = nil} var rsa2048PublicKey: Securemessage_SimpleRsaPublicKey { - get {return _rsa2048PublicKey ?? Securemessage_SimpleRsaPublicKey()} + get {_rsa2048PublicKey ?? Securemessage_SimpleRsaPublicKey()} set {_rsa2048PublicKey = newValue} } /// Returns true if `rsa2048PublicKey` has been explicitly set. - var hasRsa2048PublicKey: Bool {return self._rsa2048PublicKey != nil} + var hasRsa2048PublicKey: Bool {self._rsa2048PublicKey != nil} /// Clears the value of `rsa2048PublicKey`. Subsequent reads from it will return its default value. mutating func clearRsa2048PublicKey() {self._rsa2048PublicKey = nil} /// Use only as a last resort var dh2048PublicKey: Securemessage_DhPublicKey { - get {return _dh2048PublicKey ?? Securemessage_DhPublicKey()} + get {_dh2048PublicKey ?? Securemessage_DhPublicKey()} set {_dh2048PublicKey = newValue} } /// Returns true if `dh2048PublicKey` has been explicitly set. - var hasDh2048PublicKey: Bool {return self._dh2048PublicKey != nil} + var hasDh2048PublicKey: Bool {self._dh2048PublicKey != nil} /// Clears the value of `dh2048PublicKey`. Subsequent reads from it will return its default value. mutating func clearDh2048PublicKey() {self._dh2048PublicKey = nil} @@ -488,53 +417,25 @@ struct Securemessage_GenericPublicKey { fileprivate var _dh2048PublicKey: Securemessage_DhPublicKey? = nil } -#if swift(>=5.5) && canImport(_Concurrency) -extension Securemessage_SigScheme: @unchecked Sendable {} -extension Securemessage_EncScheme: @unchecked Sendable {} -extension Securemessage_PublicKeyType: @unchecked Sendable {} -extension Securemessage_SecureMessage: @unchecked Sendable {} -extension Securemessage_Header: @unchecked Sendable {} -extension Securemessage_HeaderAndBody: @unchecked Sendable {} -extension Securemessage_HeaderAndBodyInternal: @unchecked Sendable {} -extension Securemessage_EcP256PublicKey: @unchecked Sendable {} -extension Securemessage_SimpleRsaPublicKey: @unchecked Sendable {} -extension Securemessage_DhPublicKey: @unchecked Sendable {} -extension Securemessage_GenericPublicKey: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "securemessage" +nonisolated fileprivate let _protobuf_package = "securemessage" -extension Securemessage_SigScheme: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "HMAC_SHA256"), - 2: .same(proto: "ECDSA_P256_SHA256"), - 3: .same(proto: "RSA2048_SHA256"), - ] +nonisolated extension Securemessage_SigScheme: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}HMAC_SHA256\0\u{1}ECDSA_P256_SHA256\0\u{1}RSA2048_SHA256\0") } -extension Securemessage_EncScheme: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "NONE"), - 2: .same(proto: "AES_256_CBC"), - ] +nonisolated extension Securemessage_EncScheme: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}NONE\0\u{1}AES_256_CBC\0") } -extension Securemessage_PublicKeyType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "EC_P256"), - 2: .same(proto: "RSA2048"), - 3: .same(proto: "DH2048_MODP"), - ] +nonisolated extension Securemessage_PublicKeyType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}EC_P256\0\u{1}RSA2048\0\u{1}DH2048_MODP\0") } -extension Securemessage_SecureMessage: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_SecureMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".SecureMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "header_and_body"), - 2: .same(proto: "signature"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}header_and_body\0\u{1}signature\0") public var isInitialized: Bool { if self._headerAndBody == nil {return false} @@ -577,17 +478,9 @@ extension Securemessage_SecureMessage: @preconcurrency SwiftProtobuf.Message, @p } } -extension Securemessage_Header: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_Header: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Header" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "signature_scheme"), - 2: .standard(proto: "encryption_scheme"), - 3: .standard(proto: "verification_key_id"), - 4: .standard(proto: "decryption_key_id"), - 5: .same(proto: "iv"), - 6: .standard(proto: "public_metadata"), - 7: .standard(proto: "associated_data_length"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}signature_scheme\0\u{3}encryption_scheme\0\u{3}verification_key_id\0\u{3}decryption_key_id\0\u{1}iv\0\u{3}public_metadata\0\u{3}associated_data_length\0") public var isInitialized: Bool { if self._signatureScheme == nil {return false} @@ -655,12 +548,9 @@ extension Securemessage_Header: @preconcurrency SwiftProtobuf.Message, @preconcu } } -extension Securemessage_HeaderAndBody: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_HeaderAndBody: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".HeaderAndBody" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "header"), - 2: .same(proto: "body"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}header\0\u{1}body\0") public var isInitialized: Bool { if self._header == nil {return false} @@ -704,12 +594,9 @@ extension Securemessage_HeaderAndBody: @preconcurrency SwiftProtobuf.Message, @p } } -extension Securemessage_HeaderAndBodyInternal: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_HeaderAndBodyInternal: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".HeaderAndBodyInternal" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "header"), - 2: .same(proto: "body"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}header\0\u{1}body\0") public var isInitialized: Bool { if self._header == nil {return false} @@ -752,12 +639,9 @@ extension Securemessage_HeaderAndBodyInternal: @preconcurrency SwiftProtobuf.Mes } } -extension Securemessage_EcP256PublicKey: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_EcP256PublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".EcP256PublicKey" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "x"), - 2: .same(proto: "y"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}x\0\u{1}y\0") public var isInitialized: Bool { if self._x == nil {return false} @@ -800,12 +684,9 @@ extension Securemessage_EcP256PublicKey: @preconcurrency SwiftProtobuf.Message, } } -extension Securemessage_SimpleRsaPublicKey: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_SimpleRsaPublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".SimpleRsaPublicKey" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "n"), - 2: .same(proto: "e"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}n\0\u{1}e\0") public var isInitialized: Bool { if self._n == nil {return false} @@ -847,11 +728,9 @@ extension Securemessage_SimpleRsaPublicKey: @preconcurrency SwiftProtobuf.Messag } } -extension Securemessage_DhPublicKey: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_DhPublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".DhPublicKey" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "y"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}y\0") public var isInitialized: Bool { if self._y == nil {return false} @@ -888,14 +767,9 @@ extension Securemessage_DhPublicKey: @preconcurrency SwiftProtobuf.Message, @pre } } -extension Securemessage_GenericPublicKey: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securemessage_GenericPublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".GenericPublicKey" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .standard(proto: "ec_p256_public_key"), - 3: .standard(proto: "rsa2048_public_key"), - 4: .standard(proto: "dh2048_public_key"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}ec_p256_public_key\0\u{3}rsa2048_public_key\0\u{3}dh2048_public_key\0") public var isInitialized: Bool { if self._type == nil {return false} diff --git a/airsync-mac/Core/QuickShare/Protobuf/sharing_enums.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/sharing_enums.pb.swift index 3f67c88c..c9cacc86 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/sharing_enums.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/sharing_enums.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: sharing_enums.proto @@ -21,8 +22,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation -import SwiftProtobuf +@preconcurrency 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 @@ -30,7 +30,7 @@ import SwiftProtobuf // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } @@ -41,3428 +41,1347 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP /// equivalence for Windows) for all events (may exclude settings), and /// session_id for a pair of events (start and end of a session). /// Next id: 74 -enum Location_Nearby_Proto_Sharing_EventType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownEventType // = 0 +enum Location_Nearby_Proto_Sharing_EventType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownEventType = 0 /// When new users accept agreements (like grant permission to contacts for /// CONTACT_ONLY visibility) and are enrolled into Nearby Sharing. This event /// is used to count number of new users. - case acceptAgreements // = 1 + case acceptAgreements = 1 /// User enables/disables nearby sharing from setting or tile service. - case enableNearbySharing // = 2 + case enableNearbySharing = 2 /// User sets visibility preference from setting. - case setVisibility // = 3 + case setVisibility = 3 /// Describe attachments immediately when Nearby Sharing is opened by another /// app which is used to generate/attach attachments to be shared with other /// devices. - case describeAttachments // = 4 + case describeAttachments = 4 /// Start of a scanning phase at sender. - case scanForShareTargetsStart // = 5 + case scanForShareTargetsStart = 5 /// End of the scanning phase at sender. - case scanForShareTargetsEnd // = 6 + case scanForShareTargetsEnd = 6 /// Receiver advertises itself for presence (a pseudo session). - case advertiseDevicePresenceStart // = 7 + case advertiseDevicePresenceStart = 7 /// End of the advertising phase at receiver. - case advertiseDevicePresenceEnd // = 8 + case advertiseDevicePresenceEnd = 8 /// Sender sends a fast initialization to receiver. - case sendFastInitialization // = 9 + case sendFastInitialization = 9 /// Receiver receives the fast initialization. - case receiveFastInitialization // = 10 + case receiveFastInitialization = 10 /// Sender discovers a share target. - case discoverShareTarget // = 11 + case discoverShareTarget = 11 /// Sender sends introduction (before attachments being sent). - case sendIntroduction // = 12 + case sendIntroduction = 12 /// Receiver receives introduction. - case receiveIntroduction // = 13 + case receiveIntroduction = 13 /// Receiver responds to introduction (before attachments being sent). /// Actions: Accept, Reject, or (for some reason) Fail. - case respondToIntroduction // = 14 + case respondToIntroduction = 14 /// Start of the sending attachments phase at sender. - case sendAttachmentsStart // = 15 + case sendAttachmentsStart = 15 /// End of sending attachments phase at sender. - case sendAttachmentsEnd // = 16 + case sendAttachmentsEnd = 16 /// Start of the receiving attachments phase at receiver. - case receiveAttachmentsStart // = 17 + case receiveAttachmentsStart = 17 /// End of receiving attachments phase at receiver. - case receiveAttachmentsEnd // = 18 + case receiveAttachmentsEnd = 18 /// Sender cancels sending attachments. - case cancelSendingAttachments // = 19 + case cancelSendingAttachments = 19 /// Receiver cancels receiving attachments. - case cancelReceivingAttachments // = 20 + case cancelReceivingAttachments = 20 /// Receiver opens received attachments. - case openReceivedAttachments // = 21 + case openReceivedAttachments = 21 /// User opens the setup activity. - case launchSetupActivity // = 22 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case launchSetupActivity = 22 /// User adds a contact. - case addContact // = 23 + case addContact = 23 /// User removes a contact. - case removeContact // = 24 + case removeContact = 24 /// Local devices all Fast Share server. - case fastShareServerResponse // = 25 + case fastShareServerResponse = 25 /// The start of a sending session. - case sendStart // = 26 + case sendStart = 26 /// Receiver accepts a fast initialization. - case acceptFastInitialization // = 27 + case acceptFastInitialization = 27 /// Set data usage preference. - case setDataUsage // = 28 + case setDataUsage = 28 /// Receiver dismisses a fast initialization - case dismissFastInitialization // = 29 + case dismissFastInitialization = 29 /// Cancel connection. - case cancelConnection // = 30 + case cancelConnection = 30 /// User starts a chimera activity (e.g. ConsentsChimeraActivity, /// DeviceVisibilityChimeraActivity...) - case launchActivity // = 31 + case launchActivity = 31 /// Receiver dismisses a privacy notification. - case dismissPrivacyNotification // = 32 + case dismissPrivacyNotification = 32 /// Receiver taps a privacy notification. - case tapPrivacyNotification // = 33 + case tapPrivacyNotification = 33 /// Receiver taps a help page. - case tapHelp // = 34 + case tapHelp = 34 /// Receiver taps a feedback. - case tapFeedback // = 35 + case tapFeedback = 35 /// Receiver adds quick settings tile. - case addQuickSettingsTile // = 36 + case addQuickSettingsTile = 36 /// Receiver removes quick settings tile. - case removeQuickSettingsTile // = 37 + case removeQuickSettingsTile = 37 /// Receiver phone consent clicked. - case launchPhoneConsent // = 38 + case launchPhoneConsent = 38 /// Devices show a phone consent banner in Nearby Share Settings - case displayPhoneConsent // = 54 + case displayPhoneConsent = 54 /// Receiver taps quick settings tile. - case tapQuickSettingsTile // = 39 + case tapQuickSettingsTile = 39 /// Receiver Installation of APKs status. - case installApk // = 40 + case installApk = 40 /// Receiver verification of APKs status. - case verifyApk // = 41 + case verifyApk = 41 /// User starts a consent. - case launchConsent // = 42 + case launchConsent = 42 /// After receiving payloads, Nearby Share still needs to transfer the payloads /// to correct attachment formats and move files attachments from temporary /// directory to final destination. - case processReceivedAttachmentsEnd // = 43 + case processReceivedAttachmentsEnd = 43 /// Toggle Show Notification setting item in Nearby Share setting. - case toggleShowNotification // = 44 + case toggleShowNotification = 44 /// Set device name - case setDeviceName // = 45 + case setDeviceName = 45 /// users dropped off opt-in page. - case declineAgreements // = 46 + case declineAgreements = 46 /// Request setting permissions (Wifi/BT/location/airplane mode). - case requestSettingPermissions // = 47 + case requestSettingPermissions = 47 /// Set up a connection with the remote device. - case establishConnection // = 48 + case establishConnection = 48 /// Track device states in Nearby Share setting. - case deviceSettings // = 49 + case deviceSettings = 49 /// Receiver auto dismisses a fast initialization notification. - case autoDismissFastInitialization // = 50 + case autoDismissFastInitialization = 50 /// App Crash event. /// Used only for Windows App now. - case appCrash // = 51 + case appCrash = 51 /// Sender taps the Send button in quick settings - case tapQuickSettingsFileShare // = 52 + case tapQuickSettingsFileShare = 52 /// Devices show a privacy notification - case displayPrivacyNotification // = 53 + case displayPrivacyNotification = 53 /// Preference usage event (e.g. load/save preferences, etc). /// Used only for Windows App now. - case preferencesUsage // = 55 + case preferencesUsage = 55 /// Default opt in - case defaultOptIn // = 56 + case defaultOptIn = 56 /// The result of the setup wizard flow - case setupWizard // = 57 + case setupWizard = 57 /// Sender taps a QR code - case tapQrCode // = 58 + case tapQrCode = 58 /// QR code link shown - case qrCodeLinkShown // = 59 + case qrCodeLinkShown = 59 /// Sender failed to parse endpoint id. - case parsingFailedEndpointID // = 60 + case parsingFailedEndpointID = 60 /// The device is discovered by fast initialization - case fastInitDiscoverDevice // = 61 + case fastInitDiscoverDevice = 61 /// Send desktop notification. - case sendDesktopNotification // = 62 + case sendDesktopNotification = 62 /// User sets account preference - case setAccount // = 63 + case setAccount = 63 /// Decrypt certificate failure - case decryptCertificateFailure // = 64 + case decryptCertificateFailure = 64 /// Show allow permission auto access UI - case showAllowPermissionAutoAccess // = 65 + case showAllowPermissionAutoAccess = 65 /// UI events for transferring files with desktop applications. It includes /// event types such as DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE. - case sendDesktopTransferEvent // = 66 + case sendDesktopTransferEvent = 66 /// Show accept button on Quick Share receive UI - case waitingForAccept // = 67 + case waitingForAccept = 67 /// High quality event setup - case highQualityMediumSetup // = 68 + case highQualityMediumSetup = 68 /// RPC call status - case rpcCallStatus // = 69 + case rpcCallStatus = 69 /// A QR code sharing session has started - case startQrCodeSession // = 70 + case startQrCodeSession = 70 /// A QR code URL has been opened in a web client/browser instead of in a /// native Quick Share app. - case qrCodeOpenedInWebClient // = 71 + case qrCodeOpenedInWebClient = 71 /// A HaTS survey session id has been joined with Quick Share flow id. - case hatsJointEvent // = 72 + case hatsJointEvent = 72 /// Previews received. - case receivePreviews // = 73 + case receivePreviews = 73 init() { self = .unknownEventType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownEventType - case 1: self = .acceptAgreements - case 2: self = .enableNearbySharing - case 3: self = .setVisibility - case 4: self = .describeAttachments - case 5: self = .scanForShareTargetsStart - case 6: self = .scanForShareTargetsEnd - case 7: self = .advertiseDevicePresenceStart - case 8: self = .advertiseDevicePresenceEnd - case 9: self = .sendFastInitialization - case 10: self = .receiveFastInitialization - case 11: self = .discoverShareTarget - case 12: self = .sendIntroduction - case 13: self = .receiveIntroduction - case 14: self = .respondToIntroduction - case 15: self = .sendAttachmentsStart - case 16: self = .sendAttachmentsEnd - case 17: self = .receiveAttachmentsStart - case 18: self = .receiveAttachmentsEnd - case 19: self = .cancelSendingAttachments - case 20: self = .cancelReceivingAttachments - case 21: self = .openReceivedAttachments - case 22: self = .launchSetupActivity - case 23: self = .addContact - case 24: self = .removeContact - case 25: self = .fastShareServerResponse - case 26: self = .sendStart - case 27: self = .acceptFastInitialization - case 28: self = .setDataUsage - case 29: self = .dismissFastInitialization - case 30: self = .cancelConnection - case 31: self = .launchActivity - case 32: self = .dismissPrivacyNotification - case 33: self = .tapPrivacyNotification - case 34: self = .tapHelp - case 35: self = .tapFeedback - case 36: self = .addQuickSettingsTile - case 37: self = .removeQuickSettingsTile - case 38: self = .launchPhoneConsent - case 39: self = .tapQuickSettingsTile - case 40: self = .installApk - case 41: self = .verifyApk - case 42: self = .launchConsent - case 43: self = .processReceivedAttachmentsEnd - case 44: self = .toggleShowNotification - case 45: self = .setDeviceName - case 46: self = .declineAgreements - case 47: self = .requestSettingPermissions - case 48: self = .establishConnection - case 49: self = .deviceSettings - case 50: self = .autoDismissFastInitialization - case 51: self = .appCrash - case 52: self = .tapQuickSettingsFileShare - case 53: self = .displayPrivacyNotification - case 54: self = .displayPhoneConsent - case 55: self = .preferencesUsage - case 56: self = .defaultOptIn - case 57: self = .setupWizard - case 58: self = .tapQrCode - case 59: self = .qrCodeLinkShown - case 60: self = .parsingFailedEndpointID - case 61: self = .fastInitDiscoverDevice - case 62: self = .sendDesktopNotification - case 63: self = .setAccount - case 64: self = .decryptCertificateFailure - case 65: self = .showAllowPermissionAutoAccess - case 66: self = .sendDesktopTransferEvent - case 67: self = .waitingForAccept - case 68: self = .highQualityMediumSetup - case 69: self = .rpcCallStatus - case 70: self = .startQrCodeSession - case 71: self = .qrCodeOpenedInWebClient - case 72: self = .hatsJointEvent - case 73: self = .receivePreviews - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownEventType: return 0 - case .acceptAgreements: return 1 - case .enableNearbySharing: return 2 - case .setVisibility: return 3 - case .describeAttachments: return 4 - case .scanForShareTargetsStart: return 5 - case .scanForShareTargetsEnd: return 6 - case .advertiseDevicePresenceStart: return 7 - case .advertiseDevicePresenceEnd: return 8 - case .sendFastInitialization: return 9 - case .receiveFastInitialization: return 10 - case .discoverShareTarget: return 11 - case .sendIntroduction: return 12 - case .receiveIntroduction: return 13 - case .respondToIntroduction: return 14 - case .sendAttachmentsStart: return 15 - case .sendAttachmentsEnd: return 16 - case .receiveAttachmentsStart: return 17 - case .receiveAttachmentsEnd: return 18 - case .cancelSendingAttachments: return 19 - case .cancelReceivingAttachments: return 20 - case .openReceivedAttachments: return 21 - case .launchSetupActivity: return 22 - case .addContact: return 23 - case .removeContact: return 24 - case .fastShareServerResponse: return 25 - case .sendStart: return 26 - case .acceptFastInitialization: return 27 - case .setDataUsage: return 28 - case .dismissFastInitialization: return 29 - case .cancelConnection: return 30 - case .launchActivity: return 31 - case .dismissPrivacyNotification: return 32 - case .tapPrivacyNotification: return 33 - case .tapHelp: return 34 - case .tapFeedback: return 35 - case .addQuickSettingsTile: return 36 - case .removeQuickSettingsTile: return 37 - case .launchPhoneConsent: return 38 - case .tapQuickSettingsTile: return 39 - case .installApk: return 40 - case .verifyApk: return 41 - case .launchConsent: return 42 - case .processReceivedAttachmentsEnd: return 43 - case .toggleShowNotification: return 44 - case .setDeviceName: return 45 - case .declineAgreements: return 46 - case .requestSettingPermissions: return 47 - case .establishConnection: return 48 - case .deviceSettings: return 49 - case .autoDismissFastInitialization: return 50 - case .appCrash: return 51 - case .tapQuickSettingsFileShare: return 52 - case .displayPrivacyNotification: return 53 - case .displayPhoneConsent: return 54 - case .preferencesUsage: return 55 - case .defaultOptIn: return 56 - case .setupWizard: return 57 - case .tapQrCode: return 58 - case .qrCodeLinkShown: return 59 - case .parsingFailedEndpointID: return 60 - case .fastInitDiscoverDevice: return 61 - case .sendDesktopNotification: return 62 - case .setAccount: return 63 - case .decryptCertificateFailure: return 64 - case .showAllowPermissionAutoAccess: return 65 - case .sendDesktopTransferEvent: return 66 - case .waitingForAccept: return 67 - case .highQualityMediumSetup: return 68 - case .rpcCallStatus: return 69 - case .startQrCodeSession: return 70 - case .qrCodeOpenedInWebClient: return 71 - case .hatsJointEvent: return 72 - case .receivePreviews: return 73 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_EventType: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// Event category to differentiate whether this comes from sender or receiver, /// whether this is for communication flow, or for settings. -enum Location_Nearby_Proto_Sharing_EventCategory: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownEventCategory // = 0 - case sendingEvent // = 1 - case receivingEvent // = 2 - case settingsEvent // = 3 - case rpcEvent // = 4 +enum Location_Nearby_Proto_Sharing_EventCategory: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownEventCategory = 0 + case sendingEvent = 1 + case receivingEvent = 2 + case settingsEvent = 3 + case rpcEvent = 4 init() { self = .unknownEventCategory } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownEventCategory - case 1: self = .sendingEvent - case 2: self = .receivingEvent - case 3: self = .settingsEvent - case 4: self = .rpcEvent - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownEventCategory: return 0 - case .sendingEvent: return 1 - case .receivingEvent: return 2 - case .settingsEvent: return 3 - case .rpcEvent: return 4 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_EventCategory: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// Status of nearby sharing. -enum Location_Nearby_Proto_Sharing_NearbySharingStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownNearbySharingStatus // = 0 - case on // = 1 - case off // = 2 +enum Location_Nearby_Proto_Sharing_NearbySharingStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownNearbySharingStatus = 0 + case on = 1 + case off = 2 init() { self = .unknownNearbySharingStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownNearbySharingStatus - case 1: self = .on - case 2: self = .off - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownNearbySharingStatus: return 0 - case .on: return 1 - case .off: return 2 - } - } - } -#if swift(>=4.2) +enum Location_Nearby_Proto_Sharing_Visibility: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownVisibility = 0 + case contactsOnly = 1 + case everyone = 2 -extension Location_Nearby_Proto_Sharing_NearbySharingStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_Visibility: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownVisibility // = 0 - case contactsOnly // = 1 - case everyone // = 2 - case selectedContactsOnly // = 3 - case hidden // = 4 - case selfShare // = 5 + /// NOTE: This enum value was marked as deprecated in the .proto file + case selectedContactsOnly = 3 + case hidden = 4 + case selfShare = 5 init() { self = .unknownVisibility } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownVisibility - case 1: self = .contactsOnly - case 2: self = .everyone - case 3: self = .selectedContactsOnly - case 4: self = .hidden - case 5: self = .selfShare - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownVisibility: return 0 - case .contactsOnly: return 1 - case .everyone: return 2 - case .selectedContactsOnly: return 3 - case .hidden: return 4 - case .selfShare: return 5 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_Visibility: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_DataUsage: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownDataUsage // = 0 - case online // = 1 - case wifiOnly // = 2 - case offline // = 3 +enum Location_Nearby_Proto_Sharing_DataUsage: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownDataUsage = 0 + case online = 1 + case wifiOnly = 2 + case offline = 3 init() { self = .unknownDataUsage } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownDataUsage - case 1: self = .online - case 2: self = .wifiOnly - case 3: self = .offline - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownDataUsage: return 0 - case .online: return 1 - case .wifiOnly: return 2 - case .offline: return 3 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_DataUsage: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The status of establishing a connection. Used by ESTABLISH_CONNECTION. -enum Location_Nearby_Proto_Sharing_EstablishConnectionStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case connectionStatusUnknown // = 0 - case connectionStatusSuccess // = 1 - case connectionStatusFailure // = 2 - case connectionStatusCancellation // = 3 - case connectionStatusMediaUnavailableAttachment // = 4 - case connectionStatusFailedPairedKeyhandshake // = 5 - case connectionStatusFailedWriteIntroduction // = 6 - case connectionStatusFailedNullConnection // = 7 - case connectionStatusFailedNoTransferUpdateCallback // = 8 - case connectionStatusLostConnectivity // = 9 +enum Location_Nearby_Proto_Sharing_EstablishConnectionStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case connectionStatusUnknown = 0 + case connectionStatusSuccess = 1 + case connectionStatusFailure = 2 + case connectionStatusCancellation = 3 + case connectionStatusMediaUnavailableAttachment = 4 + case connectionStatusFailedPairedKeyhandshake = 5 + case connectionStatusFailedWriteIntroduction = 6 + case connectionStatusFailedNullConnection = 7 + case connectionStatusFailedNoTransferUpdateCallback = 8 + case connectionStatusLostConnectivity = 9 /// TODO: b/341782941 - : Annote this status when it's confirmed by Nearby /// Connections team. - case connectionStatusInvalidAdvertisement // = 10 + case connectionStatusInvalidAdvertisement = 10 init() { self = .connectionStatusUnknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .connectionStatusUnknown - case 1: self = .connectionStatusSuccess - case 2: self = .connectionStatusFailure - case 3: self = .connectionStatusCancellation - case 4: self = .connectionStatusMediaUnavailableAttachment - case 5: self = .connectionStatusFailedPairedKeyhandshake - case 6: self = .connectionStatusFailedWriteIntroduction - case 7: self = .connectionStatusFailedNullConnection - case 8: self = .connectionStatusFailedNoTransferUpdateCallback - case 9: self = .connectionStatusLostConnectivity - case 10: self = .connectionStatusInvalidAdvertisement - default: return nil - } - } +} - var rawValue: Int { - switch self { - case .connectionStatusUnknown: return 0 - case .connectionStatusSuccess: return 1 - case .connectionStatusFailure: return 2 - case .connectionStatusCancellation: return 3 - case .connectionStatusMediaUnavailableAttachment: return 4 - case .connectionStatusFailedPairedKeyhandshake: return 5 - case .connectionStatusFailedWriteIntroduction: return 6 - case .connectionStatusFailedNullConnection: return 7 - case .connectionStatusFailedNoTransferUpdateCallback: return 8 - case .connectionStatusLostConnectivity: return 9 - case .connectionStatusInvalidAdvertisement: return 10 - } - } +/// The status of sending and receiving attachments. Used by SEND_ATTACHMENTS. +enum Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownAttachmentTransmissionStatus = 0 + case completeAttachmentTransmissionStatus = 1 + case canceledAttachmentTransmissionStatus = 2 + case failedAttachmentTransmissionStatus = 3 -} + /// NOTE: This enum value was marked as deprecated in the .proto file + case rejectedAttachment = 4 -#if swift(>=4.2) + /// NOTE: This enum value was marked as deprecated in the .proto file + case timedOutAttachment = 5 -extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: CaseIterable { - // Support synthesized by the compiler. -} + /// NOTE: This enum value was marked as deprecated in the .proto file + case awaitingRemoteAcceptanceFailedAttachment = 6 -#endif // swift(>=4.2) + /// NOTE: This enum value was marked as deprecated in the .proto file + case notEnoughSpaceAttachment = 7 -/// The status of sending and receiving attachments. Used by SEND_ATTACHMENTS. -enum Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownAttachmentTransmissionStatus // = 0 - case completeAttachmentTransmissionStatus // = 1 - case canceledAttachmentTransmissionStatus // = 2 - case failedAttachmentTransmissionStatus // = 3 - case rejectedAttachment // = 4 - case timedOutAttachment // = 5 - case awaitingRemoteAcceptanceFailedAttachment // = 6 - case notEnoughSpaceAttachment // = 7 - case failedNoTransferUpdateCallback // = 8 - case mediaUnavailableAttachment // = 9 - case unsupportedAttachmentTypeAttachment // = 10 - case noAttachmentFound // = 11 - case failedNoShareTargetEndpoint // = 12 - case failedPairedKeyhandshake // = 13 - case failedNullConnection // = 14 - case failedNoPayload // = 15 - case failedWriteIntroduction // = 16 + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedNoTransferUpdateCallback = 8 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case mediaUnavailableAttachment = 9 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case unsupportedAttachmentTypeAttachment = 10 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case noAttachmentFound = 11 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedNoShareTargetEndpoint = 12 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedPairedKeyhandshake = 13 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedNullConnection = 14 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedNoPayload = 15 + + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedWriteIntroduction = 16 /// The remote response is either missing or has an unknown type. - case failedUnknownRemoteResponse // = 17 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedUnknownRemoteResponse = 17 /// Breakdowns of FAILED_NULL_CONNECTION (Desktop side) - case failedNullConnectionInitOutgoing // = 18 - case failedNullConnectionDisconnected // = 19 + case failedNullConnectionInitOutgoing = 18 + case failedNullConnectionDisconnected = 19 /// Breakdowns of FAILED_NULL_CONNECTION (android side) /// Connection failed due to Wifi is disconnected or Bluetooth setting is off /// or user turn on airplane mode. - case failedNullConnectionLostConnectivity // = 20 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedNullConnectionLostConnectivity = 20 /// Unexpected connection failure. - case failedNullConnectionFailure // = 21 - case rejectedAttachmentTransmissionStatus // = 22 - case timedOutAttachmentTransmissionStatus // = 23 - case notEnoughSpaceAttachmentTransmissionStatus // = 24 - case unsupportedAttachmentTypeAttachmentTransmissionStatus // = 25 - case failedUnknownRemoteResponseTransmissionStatus // = 26 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case failedNullConnectionFailure = 21 + case rejectedAttachmentTransmissionStatus = 22 + case timedOutAttachmentTransmissionStatus = 23 + case notEnoughSpaceAttachmentTransmissionStatus = 24 + case unsupportedAttachmentTypeAttachmentTransmissionStatus = 25 + case failedUnknownRemoteResponseTransmissionStatus = 26 /// Connection failed due to Wifi is disconnected or Bluetooth setting is off /// or user turn on airplane mode. - case noResponseFrameConnectionClosedLostConnectivityTransmissionStatus // = 27 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case noResponseFrameConnectionClosedLostConnectivityTransmissionStatus = 27 /// Unexpected connection failure due to no response frame. - case noResponseFrameConnectionClosedTransmissionStatus // = 28 + case noResponseFrameConnectionClosedTransmissionStatus = 28 /// Connection failed due to Wifi is disconnected or Bluetooth setting is off /// or user turn on airplane mode. - case lostConnectivityTransmissionStatus // = 29 + case lostConnectivityTransmissionStatus = 29 /// Connection failed due to the medium is not allowed. - case failedDisallowedMedium // = 30 + case failedDisallowedMedium = 30 init() { self = .unknownAttachmentTransmissionStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownAttachmentTransmissionStatus - case 1: self = .completeAttachmentTransmissionStatus - case 2: self = .canceledAttachmentTransmissionStatus - case 3: self = .failedAttachmentTransmissionStatus - case 4: self = .rejectedAttachment - case 5: self = .timedOutAttachment - case 6: self = .awaitingRemoteAcceptanceFailedAttachment - case 7: self = .notEnoughSpaceAttachment - case 8: self = .failedNoTransferUpdateCallback - case 9: self = .mediaUnavailableAttachment - case 10: self = .unsupportedAttachmentTypeAttachment - case 11: self = .noAttachmentFound - case 12: self = .failedNoShareTargetEndpoint - case 13: self = .failedPairedKeyhandshake - case 14: self = .failedNullConnection - case 15: self = .failedNoPayload - case 16: self = .failedWriteIntroduction - case 17: self = .failedUnknownRemoteResponse - case 18: self = .failedNullConnectionInitOutgoing - case 19: self = .failedNullConnectionDisconnected - case 20: self = .failedNullConnectionLostConnectivity - case 21: self = .failedNullConnectionFailure - case 22: self = .rejectedAttachmentTransmissionStatus - case 23: self = .timedOutAttachmentTransmissionStatus - case 24: self = .notEnoughSpaceAttachmentTransmissionStatus - case 25: self = .unsupportedAttachmentTypeAttachmentTransmissionStatus - case 26: self = .failedUnknownRemoteResponseTransmissionStatus - case 27: self = .noResponseFrameConnectionClosedLostConnectivityTransmissionStatus - case 28: self = .noResponseFrameConnectionClosedTransmissionStatus - case 29: self = .lostConnectivityTransmissionStatus - case 30: self = .failedDisallowedMedium - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownAttachmentTransmissionStatus: return 0 - case .completeAttachmentTransmissionStatus: return 1 - case .canceledAttachmentTransmissionStatus: return 2 - case .failedAttachmentTransmissionStatus: return 3 - case .rejectedAttachment: return 4 - case .timedOutAttachment: return 5 - case .awaitingRemoteAcceptanceFailedAttachment: return 6 - case .notEnoughSpaceAttachment: return 7 - case .failedNoTransferUpdateCallback: return 8 - case .mediaUnavailableAttachment: return 9 - case .unsupportedAttachmentTypeAttachment: return 10 - case .noAttachmentFound: return 11 - case .failedNoShareTargetEndpoint: return 12 - case .failedPairedKeyhandshake: return 13 - case .failedNullConnection: return 14 - case .failedNoPayload: return 15 - case .failedWriteIntroduction: return 16 - case .failedUnknownRemoteResponse: return 17 - case .failedNullConnectionInitOutgoing: return 18 - case .failedNullConnectionDisconnected: return 19 - case .failedNullConnectionLostConnectivity: return 20 - case .failedNullConnectionFailure: return 21 - case .rejectedAttachmentTransmissionStatus: return 22 - case .timedOutAttachmentTransmissionStatus: return 23 - case .notEnoughSpaceAttachmentTransmissionStatus: return 24 - case .unsupportedAttachmentTypeAttachmentTransmissionStatus: return 25 - case .failedUnknownRemoteResponseTransmissionStatus: return 26 - case .noResponseFrameConnectionClosedLostConnectivityTransmissionStatus: return 27 - case .noResponseFrameConnectionClosedTransmissionStatus: return 28 - case .lostConnectivityTransmissionStatus: return 29 - case .failedDisallowedMedium: return 30 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// Generic result status of NearbyConnections API calls. -enum Location_Nearby_Proto_Sharing_ConnectionLayerStatus: SwiftProtobuf.Enum { - typealias RawValue = Int +enum Location_Nearby_Proto_Sharing_ConnectionLayerStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { /// No status is available - case unknown // = 0 + case unknown = 0 /// The operation was successful. - case success // = 1 + case success = 1 /// The operation failed, without any more information. - case error // = 2 + case error = 2 /// The app called an API method out of order (i.e. another method is expected /// to be called first). - case outOfOrderApiCall // = 3 + case outOfOrderApiCall = 3 /// The app already has active operations (advertising, discovering, or /// connected to other devices) with another Strategy. Stop these operations on /// the current Strategy before trying to advertise or discover with a new /// Strategy. - case alreadyHaveActiveStrategy // = 4 + case alreadyHaveActiveStrategy = 4 /// The app is already advertising; call StopAdvertising() before trying to /// advertise again. - case alreadyAdvertising // = 5 + case alreadyAdvertising = 5 /// The app is already discovering; call StopDiscovery() before trying to /// discover again. - case alreadyDiscovering // = 6 + case alreadyDiscovering = 6 /// NC is already listening for incoming connections from remote endpoints. - case alreadyListening // = 7 + case alreadyListening = 7 /// An attempt to read from/write to a connected remote endpoint failed. If /// this occurs repeatedly, consider invoking DisconnectFromEndpoint(). - case endPointIoError // = 8 + case endPointIoError = 8 /// An attempt to interact with a remote endpoint failed because it's unknown /// to us -- it's either an endpoint that was never discovered, or an endpoint /// that never connected to us (both of which are indicative of bad input from /// the client app). - case endPointUnknown // = 9 + case endPointUnknown = 9 /// The remote endpoint rejected the connection request. - case connectionRejected // = 10 + case connectionRejected = 10 /// The app is already connected to the specified endpoint. Multiple /// connections to a remote endpoint cannot be maintained simultaneously. - case alreadyConnectedToEndPoint // = 11 + case alreadyConnectedToEndPoint = 11 /// The remote endpoint is not connected; messages cannot be sent to it. - case notConnectedToEndPoint // = 12 + case notConnectedToEndPoint = 12 /// There was an error trying to use the device's Bluetooth capabilities. - case bluetoothError // = 13 + case bluetoothError = 13 /// There was an error trying to use the device's Bluetooth Low Energy /// capabilities. - case bleError // = 14 + case bleError = 14 /// There was an error trying to use the device's Wi-Fi capabilities. - case wifiLanError // = 15 + case wifiLanError = 15 /// An attempt to interact with an in-flight Payload failed because it's /// unknown to us. - case payloadUnknown // = 16 + case payloadUnknown = 16 /// The connection was reset - case reset // = 17 + case reset = 17 /// The connection timed out - case timeout // = 18 + case timeout = 18 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .success - case 2: self = .error - case 3: self = .outOfOrderApiCall - case 4: self = .alreadyHaveActiveStrategy - case 5: self = .alreadyAdvertising - case 6: self = .alreadyDiscovering - case 7: self = .alreadyListening - case 8: self = .endPointIoError - case 9: self = .endPointUnknown - case 10: self = .connectionRejected - case 11: self = .alreadyConnectedToEndPoint - case 12: self = .notConnectedToEndPoint - case 13: self = .bluetoothError - case 14: self = .bleError - case 15: self = .wifiLanError - case 16: self = .payloadUnknown - case 17: self = .reset - case 18: self = .timeout - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .success: return 1 - case .error: return 2 - case .outOfOrderApiCall: return 3 - case .alreadyHaveActiveStrategy: return 4 - case .alreadyAdvertising: return 5 - case .alreadyDiscovering: return 6 - case .alreadyListening: return 7 - case .endPointIoError: return 8 - case .endPointUnknown: return 9 - case .connectionRejected: return 10 - case .alreadyConnectedToEndPoint: return 11 - case .notConnectedToEndPoint: return 12 - case .bluetoothError: return 13 - case .bleError: return 14 - case .wifiLanError: return 15 - case .payloadUnknown: return 16 - case .reset: return 17 - case .timeout: return 18 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The status of processing attachments after receiver received payloads /// successfully. -enum Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case processingStatusUnknown // = 0 - case processingStatusCompleteProcessingAttachments // = 1 - case processingStatusFailedMovingFiles // = 2 - case processingStatusFailedReceivingApk // = 3 - case processingStatusFailedReceivingText // = 4 - case processingStatusFailedReceivingWifiCredentials // = 5 +enum Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case processingStatusUnknown = 0 + case processingStatusCompleteProcessingAttachments = 1 + case processingStatusFailedMovingFiles = 2 + case processingStatusFailedReceivingApk = 3 + case processingStatusFailedReceivingText = 4 + case processingStatusFailedReceivingWifiCredentials = 5 init() { self = .processingStatusUnknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .processingStatusUnknown - case 1: self = .processingStatusCompleteProcessingAttachments - case 2: self = .processingStatusFailedMovingFiles - case 3: self = .processingStatusFailedReceivingApk - case 4: self = .processingStatusFailedReceivingText - case 5: self = .processingStatusFailedReceivingWifiCredentials - default: return nil - } - } - - var rawValue: Int { - switch self { - case .processingStatusUnknown: return 0 - case .processingStatusCompleteProcessingAttachments: return 1 - case .processingStatusFailedMovingFiles: return 2 - case .processingStatusFailedReceivingApk: return 3 - case .processingStatusFailedReceivingText: return 4 - case .processingStatusFailedReceivingWifiCredentials: return 5 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The status of advertising and discovering sessions. Used by /// SCAN_FOR_SHARE_TARGETS and ADVERTISE_DEVICE_PRESENCE. -enum Location_Nearby_Proto_Sharing_SessionStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownSessionStatus // = 0 - case succeededSessionStatus // = 1 +enum Location_Nearby_Proto_Sharing_SessionStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownSessionStatus = 0 + case succeededSessionStatus = 1 /// TODO: b/341782941 - FAILED_SESSION_STATUS occurs when the status of /// advertising or discovering sessions is not successful. It can be /// due to STATUS_INTERNAL_ERROR, STATUS_INTERRUPTION, STATUS_CANCELLED. /// More session statuses should be logged to determine the status. - case failedSessionStatus // = 2 + case failedSessionStatus = 2 init() { self = .unknownSessionStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownSessionStatus - case 1: self = .succeededSessionStatus - case 2: self = .failedSessionStatus - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownSessionStatus: return 0 - case .succeededSessionStatus: return 1 - case .failedSessionStatus: return 2 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_SessionStatus: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// User's response to introductions. -enum Location_Nearby_Proto_Sharing_ResponseToIntroduction: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownResponseToIntroduction // = 0 - case acceptIntroduction // = 1 - case rejectIntroduction // = 2 - case failIntroduction // = 3 +enum Location_Nearby_Proto_Sharing_ResponseToIntroduction: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownResponseToIntroduction = 0 + case acceptIntroduction = 1 + case rejectIntroduction = 2 + case failIntroduction = 3 init() { self = .unknownResponseToIntroduction } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownResponseToIntroduction - case 1: self = .acceptIntroduction - case 2: self = .rejectIntroduction - case 3: self = .failIntroduction - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownResponseToIntroduction: return 0 - case .acceptIntroduction: return 1 - case .rejectIntroduction: return 2 - case .failIntroduction: return 3 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// TODO(fdi): may eventually include desktop, etc. /// The type of a remote device. -enum Location_Nearby_Proto_Sharing_DeviceType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownDeviceType // = 0 - case phone // = 1 - case tablet // = 2 - case laptop // = 3 - case car // = 4 - case foldable // = 5 - case xr // = 6 +enum Location_Nearby_Proto_Sharing_DeviceType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownDeviceType = 0 + case phone = 1 + case tablet = 2 + case laptop = 3 + case car = 4 + case foldable = 5 + case xr = 6 init() { self = .unknownDeviceType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownDeviceType - case 1: self = .phone - case 2: self = .tablet - case 3: self = .laptop - case 4: self = .car - case 5: self = .foldable - case 6: self = .xr - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownDeviceType: return 0 - case .phone: return 1 - case .tablet: return 2 - case .laptop: return 3 - case .car: return 4 - case .foldable: return 5 - case .xr: return 6 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_DeviceType: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// TODO(fdi): may eventually include windows, iOS, etc. /// The OS type of a remote device. -enum Location_Nearby_Proto_Sharing_OSType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownOsType // = 0 - case android // = 1 - case chromeOs // = 2 - case ios // = 3 - case windows // = 4 - case macos // = 5 +enum Location_Nearby_Proto_Sharing_OSType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownOsType = 0 + case android = 1 + case chromeOs = 2 + case ios = 3 + case windows = 4 + case macos = 5 init() { self = .unknownOsType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownOsType - case 1: self = .android - case 2: self = .chromeOs - case 3: self = .ios - case 4: self = .windows - case 5: self = .macos - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownOsType: return 0 - case .android: return 1 - case .chromeOs: return 2 - case .ios: return 3 - case .windows: return 4 - case .macos: return 5 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_OSType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// Relationship of remote device to sender device. -enum Location_Nearby_Proto_Sharing_DeviceRelationship: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownDeviceRelationship // = 0 +enum Location_Nearby_Proto_Sharing_DeviceRelationship: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownDeviceRelationship = 0 /// The remote device belongs to the same owner as sender device. - case isSelf // = 1 + case isSelf = 1 /// The remote device is a contact of sender. - case isContact // = 2 + case isContact = 2 /// The remote device is a stranger. - case isStranger // = 3 + case isStranger = 3 init() { self = .unknownDeviceRelationship } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownDeviceRelationship - case 1: self = .isSelf - case 2: self = .isContact - case 3: self = .isStranger - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownDeviceRelationship: return 0 - case .isSelf: return 1 - case .isContact: return 2 - case .isStranger: return 3 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_DeviceRelationship: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The device sources of the clearcut log. -enum Location_Nearby_Proto_Sharing_LogSource: SwiftProtobuf.Enum { - typealias RawValue = Int - case unspecifiedSource // = 0 +enum Location_Nearby_Proto_Sharing_LogSource: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unspecifiedSource = 0 /// Represents the devices in Nearby labs. - case labDevices // = 1 + case labDevices = 1 /// Represents the devices tested by Nearby engs, in the long term can include /// any devices with newest feature flags. - case internalDevices // = 2 + case internalDevices = 2 /// Represents the devices testing our in-development features before they're /// released to the greater public. - case betaTesterDevices // = 3 + case betaTesterDevices = 3 /// Represents the OEM partners (like Samsung) that we're working with to /// verify functionality on their devices. - case oemDevices // = 4 + case oemDevices = 4 /// Represents the device for debugging. - case debugDevices // = 5 + case debugDevices = 5 /// Represents the device for Nearby Module Food. - case nearbyModuleFoodDevices // = 6 + case nearbyModuleFoodDevices = 6 /// Represents the device for BeTo Team Food. - case betoDogfoodDevices // = 7 + case betoDogfoodDevices = 7 /// Represents the device for Nearby dog Food. - case nearbyDogfoodDevices // = 8 + case nearbyDogfoodDevices = 8 /// Represents the device for Nearby Team Food. - case nearbyTeamfoodDevices // = 9 + case nearbyTeamfoodDevices = 9 init() { self = .unspecifiedSource } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unspecifiedSource - case 1: self = .labDevices - case 2: self = .internalDevices - case 3: self = .betaTesterDevices - case 4: self = .oemDevices - case 5: self = .debugDevices - case 6: self = .nearbyModuleFoodDevices - case 7: self = .betoDogfoodDevices - case 8: self = .nearbyDogfoodDevices - case 9: self = .nearbyTeamfoodDevices - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unspecifiedSource: return 0 - case .labDevices: return 1 - case .internalDevices: return 2 - case .betaTesterDevices: return 3 - case .oemDevices: return 4 - case .debugDevices: return 5 - case .nearbyModuleFoodDevices: return 6 - case .betoDogfoodDevices: return 7 - case .nearbyDogfoodDevices: return 8 - case .nearbyTeamfoodDevices: return 9 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_LogSource: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The Fast Share server action name. -enum Location_Nearby_Proto_Sharing_ServerActionName: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownServerAction // = 0 - case uploadCertificates // = 1 - case downloadCertificates // = 2 - case checkReachability // = 3 - case uploadContacts // = 4 - case updateDeviceName // = 5 - case uploadSenderCertificates // = 6 - case downloadSenderCertificates // = 7 - case uploadContactsAndCertificates // = 8 - case listReachablePhoneNumbers // = 9 - case listMyDevices // = 10 - case listContactPeople // = 11 +enum Location_Nearby_Proto_Sharing_ServerActionName: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownServerAction = 0 + case uploadCertificates = 1 + case downloadCertificates = 2 + case checkReachability = 3 + case uploadContacts = 4 + case updateDeviceName = 5 + case uploadSenderCertificates = 6 + case downloadSenderCertificates = 7 + case uploadContactsAndCertificates = 8 + case listReachablePhoneNumbers = 9 + case listMyDevices = 10 + case listContactPeople = 11 /// used for analytics logger to record action name. - case downloadCertificatesInfo // = 12 + case downloadCertificatesInfo = 12 init() { self = .unknownServerAction } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownServerAction - case 1: self = .uploadCertificates - case 2: self = .downloadCertificates - case 3: self = .checkReachability - case 4: self = .uploadContacts - case 5: self = .updateDeviceName - case 6: self = .uploadSenderCertificates - case 7: self = .downloadSenderCertificates - case 8: self = .uploadContactsAndCertificates - case 9: self = .listReachablePhoneNumbers - case 10: self = .listMyDevices - case 11: self = .listContactPeople - case 12: self = .downloadCertificatesInfo - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownServerAction: return 0 - case .uploadCertificates: return 1 - case .downloadCertificates: return 2 - case .checkReachability: return 3 - case .uploadContacts: return 4 - case .updateDeviceName: return 5 - case .uploadSenderCertificates: return 6 - case .downloadSenderCertificates: return 7 - case .uploadContactsAndCertificates: return 8 - case .listReachablePhoneNumbers: return 9 - case .listMyDevices: return 10 - case .listContactPeople: return 11 - case .downloadCertificatesInfo: return 12 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ServerActionName: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The Fast Share server response state. -enum Location_Nearby_Proto_Sharing_ServerResponseState: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownServerResponseState // = 0 - case serverResponseSuccess // = 1 - case serverResponseUnknownFailure // = 2 +enum Location_Nearby_Proto_Sharing_ServerResponseState: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownServerResponseState = 0 + case serverResponseSuccess = 1 + case serverResponseUnknownFailure = 2 /// For StatusException. - case serverResponseStatusOtherFailure // = 3 - case serverResponseStatusDeadlineExceeded // = 4 - case serverResponseStatusPermissionDenied // = 5 - case serverResponseStatusUnavailable // = 6 - case serverResponseStatusUnauthenticated // = 7 - case serverResponseStatusInvalidArgument // = 9 + case serverResponseStatusOtherFailure = 3 + case serverResponseStatusDeadlineExceeded = 4 + case serverResponseStatusPermissionDenied = 5 + case serverResponseStatusUnavailable = 6 + case serverResponseStatusUnauthenticated = 7 + case serverResponseStatusInvalidArgument = 9 /// For GoogleAuthException. - case serverResponseGoogleAuthFailure // = 8 + case serverResponseGoogleAuthFailure = 8 /// For Internet connect status. - case serverResponseNotConnectedToInternet // = 10 + case serverResponseNotConnectedToInternet = 10 init() { self = .unknownServerResponseState } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownServerResponseState - case 1: self = .serverResponseSuccess - case 2: self = .serverResponseUnknownFailure - case 3: self = .serverResponseStatusOtherFailure - case 4: self = .serverResponseStatusDeadlineExceeded - case 5: self = .serverResponseStatusPermissionDenied - case 6: self = .serverResponseStatusUnavailable - case 7: self = .serverResponseStatusUnauthenticated - case 8: self = .serverResponseGoogleAuthFailure - case 9: self = .serverResponseStatusInvalidArgument - case 10: self = .serverResponseNotConnectedToInternet - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownServerResponseState: return 0 - case .serverResponseSuccess: return 1 - case .serverResponseUnknownFailure: return 2 - case .serverResponseStatusOtherFailure: return 3 - case .serverResponseStatusDeadlineExceeded: return 4 - case .serverResponseStatusPermissionDenied: return 5 - case .serverResponseStatusUnavailable: return 6 - case .serverResponseStatusUnauthenticated: return 7 - case .serverResponseGoogleAuthFailure: return 8 - case .serverResponseStatusInvalidArgument: return 9 - case .serverResponseNotConnectedToInternet: return 10 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ServerResponseState: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The purpose of requesting the server request. -enum Location_Nearby_Proto_Sharing_SyncPurpose: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 +enum Location_Nearby_Proto_Sharing_SyncPurpose: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 /// When NearbySharingChimeraService#sync() is called. - case onDemandSync // = 1 + case onDemandSync = 1 /// Requested by chime notification. - case chimeNotification // = 2 + case chimeNotification = 2 /// For reqular daily sync. - case dailySync // = 3 + case dailySync = 3 /// Wen a device opts into Nearby Share. - case optInFirstSync // = 4 + case optInFirstSync = 4 /// Requested when Nearby Share automatically enables a device that shares /// a single account that has already opted in on another device. - case checkDefaultOptIn // = 5 + case checkDefaultOptIn = 5 /// When a device enables Nearby Share. - case nearbyShareEnabled // = 6 + case nearbyShareEnabled = 6 /// When a device is in fast init advertising. - case syncAtFastInit // = 7 + case syncAtFastInit = 7 /// When device start discovery. - case syncAtDiscovery // = 8 + case syncAtDiscovery = 8 /// When device tries to load valid private certificate. - case syncAtLoadPrivateCertificate // = 9 + case syncAtLoadPrivateCertificate = 9 /// When device start advertiseement. - case syncAtAdvertisement // = 10 + case syncAtAdvertisement = 10 /// When device contacts list changes. - case contactListChange // = 11 + case contactListChange = 11 /// When showing the C11 banner in Neary Share setting. - case showC11NView // = 12 + case showC11NView = 12 /// For regular check contact reachability. - case regularCheckContactReachability // = 13 + case regularCheckContactReachability = 13 /// When selected contacts list changes in visibility setting. - case visibilitySelectedContactChange // = 14 + case visibilitySelectedContactChange = 14 /// When switching account. - case accountChange // = 15 + case accountChange = 15 /// When regenerate certificates - case regenerateCertificates // = 16 + case regenerateCertificates = 16 /// When Device Contacts consent changes - case deviceContactsConsentChange // = 17 + case deviceContactsConsentChange = 17 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .onDemandSync - case 2: self = .chimeNotification - case 3: self = .dailySync - case 4: self = .optInFirstSync - case 5: self = .checkDefaultOptIn - case 6: self = .nearbyShareEnabled - case 7: self = .syncAtFastInit - case 8: self = .syncAtDiscovery - case 9: self = .syncAtLoadPrivateCertificate - case 10: self = .syncAtAdvertisement - case 11: self = .contactListChange - case 12: self = .showC11NView - case 13: self = .regularCheckContactReachability - case 14: self = .visibilitySelectedContactChange - case 15: self = .accountChange - case 16: self = .regenerateCertificates - case 17: self = .deviceContactsConsentChange - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .onDemandSync: return 1 - case .chimeNotification: return 2 - case .dailySync: return 3 - case .optInFirstSync: return 4 - case .checkDefaultOptIn: return 5 - case .nearbyShareEnabled: return 6 - case .syncAtFastInit: return 7 - case .syncAtDiscovery: return 8 - case .syncAtLoadPrivateCertificate: return 9 - case .syncAtAdvertisement: return 10 - case .contactListChange: return 11 - case .showC11NView: return 12 - case .regularCheckContactReachability: return 13 - case .visibilitySelectedContactChange: return 14 - case .accountChange: return 15 - case .regenerateCertificates: return 16 - case .deviceContactsConsentChange: return 17 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_SyncPurpose: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The device role to trigger the server request. -enum Location_Nearby_Proto_Sharing_ClientRole: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case sender // = 1 - case receiver // = 2 +enum Location_Nearby_Proto_Sharing_ClientRole: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case sender = 1 + case receiver = 2 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .sender - case 2: self = .receiver - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .sender: return 1 - case .receiver: return 2 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ClientRole: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The type of Nearby Sharing scanning. -enum Location_Nearby_Proto_Sharing_ScanType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownScanType // = 0 - case foregroundScan // = 1 - case foregroundRetryScan // = 2 - case directShareScan // = 3 - case backgroundScan // = 4 +enum Location_Nearby_Proto_Sharing_ScanType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownScanType = 0 + case foregroundScan = 1 + case foregroundRetryScan = 2 + case directShareScan = 3 + case backgroundScan = 4 init() { self = .unknownScanType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownScanType - case 1: self = .foregroundScan - case 2: self = .foregroundRetryScan - case 3: self = .directShareScan - case 4: self = .backgroundScan - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownScanType: return 0 - case .foregroundScan: return 1 - case .foregroundRetryScan: return 2 - case .directShareScan: return 3 - case .backgroundScan: return 4 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ScanType: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The type of parsing endpoint id failed type. -enum Location_Nearby_Proto_Sharing_ParsingFailedType: SwiftProtobuf.Enum { - typealias RawValue = Int - case failedUnknownType // = 0 +enum Location_Nearby_Proto_Sharing_ParsingFailedType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case failedUnknownType = 0 /// NULL advertisement is returned due to sender failing to parse advertisement /// from endpointInfo byte stream from receiver advertisement. - case failedParseAdvertisement // = 1 + case failedParseAdvertisement = 1 /// NULL shareTarget is returned due to sender failing to create shareTarget /// from a valid parsed advertisement stemming from issues in certificates, QR /// code tokens or device names. - case failedConvertShareTarget // = 2 + case failedConvertShareTarget = 2 init() { self = .failedUnknownType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .failedUnknownType - case 1: self = .failedParseAdvertisement - case 2: self = .failedConvertShareTarget - default: return nil - } - } - - var rawValue: Int { - switch self { - case .failedUnknownType: return 0 - case .failedParseAdvertisement: return 1 - case .failedConvertShareTarget: return 2 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ParsingFailedType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The Nearby Sharing advertising mode. -enum Location_Nearby_Proto_Sharing_AdvertisingMode: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownAdvertisingMode // = 0 - case screenOffAdvertisingMode // = 1 - case backgroundAdvertisingMode // = 2 - case midgroundAdvertisingMode // = 3 - case foregroundAdvertisingMode // = 4 - case suspendedAdvertisingMode // = 5 +enum Location_Nearby_Proto_Sharing_AdvertisingMode: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownAdvertisingMode = 0 + case screenOffAdvertisingMode = 1 + case backgroundAdvertisingMode = 2 + case midgroundAdvertisingMode = 3 + case foregroundAdvertisingMode = 4 + case suspendedAdvertisingMode = 5 init() { self = .unknownAdvertisingMode } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownAdvertisingMode - case 1: self = .screenOffAdvertisingMode - case 2: self = .backgroundAdvertisingMode - case 3: self = .midgroundAdvertisingMode - case 4: self = .foregroundAdvertisingMode - case 5: self = .suspendedAdvertisingMode - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownAdvertisingMode: return 0 - case .screenOffAdvertisingMode: return 1 - case .backgroundAdvertisingMode: return 2 - case .midgroundAdvertisingMode: return 3 - case .foregroundAdvertisingMode: return 4 - case .suspendedAdvertisingMode: return 5 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_AdvertisingMode: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The Nearby Sharing discovery mode. -enum Location_Nearby_Proto_Sharing_DiscoveryMode: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownDiscoveryMode // = 0 - case screenOffDiscoveryMode // = 1 - case backgroundDiscoveryMode // = 2 - case midgroundDiscoveryMode // = 3 - case foregroundDiscoveryMode // = 4 - case suspendedDiscoveryMode // = 5 +enum Location_Nearby_Proto_Sharing_DiscoveryMode: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownDiscoveryMode = 0 + case screenOffDiscoveryMode = 1 + case backgroundDiscoveryMode = 2 + case midgroundDiscoveryMode = 3 + case foregroundDiscoveryMode = 4 + case suspendedDiscoveryMode = 5 init() { self = .unknownDiscoveryMode } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownDiscoveryMode - case 1: self = .screenOffDiscoveryMode - case 2: self = .backgroundDiscoveryMode - case 3: self = .midgroundDiscoveryMode - case 4: self = .foregroundDiscoveryMode - case 5: self = .suspendedDiscoveryMode - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownDiscoveryMode: return 0 - case .screenOffDiscoveryMode: return 1 - case .backgroundDiscoveryMode: return 2 - case .midgroundDiscoveryMode: return 3 - case .foregroundDiscoveryMode: return 4 - case .suspendedDiscoveryMode: return 5 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_DiscoveryMode: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The class name of chimera activity. -enum Location_Nearby_Proto_Sharing_ActivityName: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownActivity // = 0 - case shareSheetActivity // = 1 - case settingsActivity // = 2 - case receiveSurfaceActivity // = 3 - case setupActivity // = 4 - case deviceVisibilityActivity // = 5 - case consentsActivity // = 6 - case setDeviceNameDialog // = 7 - case setDataUsageDialog // = 8 - case quickSettingsActivity // = 9 - case remoteCopyShareSheetActivity // = 10 - case setupWizardActivity // = 11 - case settingsReviewActivity // = 12 +enum Location_Nearby_Proto_Sharing_ActivityName: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownActivity = 0 + case shareSheetActivity = 1 + case settingsActivity = 2 + case receiveSurfaceActivity = 3 + case setupActivity = 4 + case deviceVisibilityActivity = 5 + case consentsActivity = 6 + case setDeviceNameDialog = 7 + case setDataUsageDialog = 8 + case quickSettingsActivity = 9 + case remoteCopyShareSheetActivity = 10 + case setupWizardActivity = 11 + case settingsReviewActivity = 12 init() { self = .unknownActivity } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownActivity - case 1: self = .shareSheetActivity - case 2: self = .settingsActivity - case 3: self = .receiveSurfaceActivity - case 4: self = .setupActivity - case 5: self = .deviceVisibilityActivity - case 6: self = .consentsActivity - case 7: self = .setDeviceNameDialog - case 8: self = .setDataUsageDialog - case 9: self = .quickSettingsActivity - case 10: self = .remoteCopyShareSheetActivity - case 11: self = .setupWizardActivity - case 12: self = .settingsReviewActivity - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownActivity: return 0 - case .shareSheetActivity: return 1 - case .settingsActivity: return 2 - case .receiveSurfaceActivity: return 3 - case .setupActivity: return 4 - case .deviceVisibilityActivity: return 5 - case .consentsActivity: return 6 - case .setDeviceNameDialog: return 7 - case .setDataUsageDialog: return 8 - case .quickSettingsActivity: return 9 - case .remoteCopyShareSheetActivity: return 10 - case .setupWizardActivity: return 11 - case .settingsReviewActivity: return 12 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ActivityName: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The type of consent page user launches. -enum Location_Nearby_Proto_Sharing_ConsentType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 +enum Location_Nearby_Proto_Sharing_ConsentType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 /// launch Constellation consent page. - case c11N // = 1 + case c11N = 1 /// launch device contact consent page. - case deviceContact // = 2 + case deviceContact = 2 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .c11N - case 2: self = .deviceContact - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .c11N: return 1 - case .deviceContact: return 2 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ConsentType: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case consentUnknownAcceptStatus // = 0 - case consentAccepted // = 1 - case consentDeclined // = 2 +enum Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case consentUnknownAcceptStatus = 0 + case consentAccepted = 1 + case consentDeclined = 2 /// unable to enable consent. - case consentUnableToEnable // = 3 + case consentUnableToEnable = 3 init() { self = .consentUnknownAcceptStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .consentUnknownAcceptStatus - case 1: self = .consentAccepted - case 2: self = .consentDeclined - case 3: self = .consentUnableToEnable - default: return nil - } - } - - var rawValue: Int { - switch self { - case .consentUnknownAcceptStatus: return 0 - case .consentAccepted: return 1 - case .consentDeclined: return 2 - case .consentUnableToEnable: return 3 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_ApkSource: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownApkSource // = 0 - case apkFromSdCard // = 1 - case installedApp // = 2 +enum Location_Nearby_Proto_Sharing_ApkSource: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownApkSource = 0 + case apkFromSdCard = 1 + case installedApp = 2 init() { self = .unknownApkSource } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownApkSource - case 1: self = .apkFromSdCard - case 2: self = .installedApp - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownApkSource: return 0 - case .apkFromSdCard: return 1 - case .installedApp: return 2 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ApkSource: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The Installation status of APK. -enum Location_Nearby_Proto_Sharing_InstallAPKStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownInstallApkStatus // = 0 - case failInstallation // = 1 - case successInstallation // = 2 +enum Location_Nearby_Proto_Sharing_InstallAPKStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownInstallApkStatus = 0 + case failInstallation = 1 + case successInstallation = 2 init() { self = .unknownInstallApkStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownInstallApkStatus - case 1: self = .failInstallation - case 2: self = .successInstallation - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownInstallApkStatus: return 0 - case .failInstallation: return 1 - case .successInstallation: return 2 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_InstallAPKStatus: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The verification status of APK. -enum Location_Nearby_Proto_Sharing_VerifyAPKStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownVerifyApkStatus // = 0 - case notInstallable // = 1 - case installable // = 2 - case alreadyInstalled // = 3 +enum Location_Nearby_Proto_Sharing_VerifyAPKStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownVerifyApkStatus = 0 + case notInstallable = 1 + case installable = 2 + case alreadyInstalled = 3 init() { self = .unknownVerifyApkStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownVerifyApkStatus - case 1: self = .notInstallable - case 2: self = .installable - case 3: self = .alreadyInstalled - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownVerifyApkStatus: return 0 - case .notInstallable: return 1 - case .installable: return 2 - case .alreadyInstalled: return 3 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_ShowNotificationStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownShowNotificationStatus // = 0 - case show // = 1 - case notShow // = 2 +enum Location_Nearby_Proto_Sharing_ShowNotificationStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownShowNotificationStatus = 0 + case show = 1 + case notShow = 2 init() { self = .unknownShowNotificationStatus } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownShowNotificationStatus - case 1: self = .show - case 2: self = .notShow - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownShowNotificationStatus: return 0 - case .show: return 1 - case .notShow: return 2 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_PermissionRequestResult: SwiftProtobuf.Enum { - typealias RawValue = Int - case permissionUnknownRequestResult // = 0 - case permissionGranted // = 1 - case permissionRejected // = 2 - case permissionUnableToGrant // = 3 +enum Location_Nearby_Proto_Sharing_PermissionRequestResult: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case permissionUnknownRequestResult = 0 + case permissionGranted = 1 + case permissionRejected = 2 + case permissionUnableToGrant = 3 init() { self = .permissionUnknownRequestResult } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .permissionUnknownRequestResult - case 1: self = .permissionGranted - case 2: self = .permissionRejected - case 3: self = .permissionUnableToGrant - default: return nil - } - } - - var rawValue: Int { - switch self { - case .permissionUnknownRequestResult: return 0 - case .permissionGranted: return 1 - case .permissionRejected: return 2 - case .permissionUnableToGrant: return 3 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_PermissionRequestResult: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_PermissionRequestType: SwiftProtobuf.Enum { - typealias RawValue = Int - case permissionUnknownType // = 0 - case permissionAirplaneModeOff // = 1 - case permissionWifi // = 2 - case permissionBluetooth // = 3 - case permissionLocation // = 4 - case permissionWifiHotspot // = 5 +enum Location_Nearby_Proto_Sharing_PermissionRequestType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case permissionUnknownType = 0 + case permissionAirplaneModeOff = 1 + case permissionWifi = 2 + case permissionBluetooth = 3 + case permissionLocation = 4 + case permissionWifiHotspot = 5 init() { self = .permissionUnknownType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .permissionUnknownType - case 1: self = .permissionAirplaneModeOff - case 2: self = .permissionWifi - case 3: self = .permissionBluetooth - case 4: self = .permissionLocation - case 5: self = .permissionWifiHotspot - default: return nil - } - } - - var rawValue: Int { - switch self { - case .permissionUnknownType: return 0 - case .permissionAirplaneModeOff: return 1 - case .permissionWifi: return 2 - case .permissionBluetooth: return 3 - case .permissionLocation: return 4 - case .permissionWifiHotspot: return 5 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_PermissionRequestType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -enum Location_Nearby_Proto_Sharing_SharingUseCase: SwiftProtobuf.Enum { - typealias RawValue = Int - case useCaseUnknown // = 0 - case useCaseNearbyShare // = 1 - case useCaseRemoteCopyPaste // = 2 - case useCaseWifiCredential // = 3 - case useCaseAppShare // = 4 - case useCaseQuickSettingFileShare // = 5 - case useCaseSetupWizard // = 6 +enum Location_Nearby_Proto_Sharing_SharingUseCase: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case useCaseUnknown = 0 + case useCaseNearbyShare = 1 + case useCaseRemoteCopyPaste = 2 + case useCaseWifiCredential = 3 + case useCaseAppShare = 4 + case useCaseQuickSettingFileShare = 5 + case useCaseSetupWizard = 6 /// Deprecated. QR code is an addition to existing use cases rather than being /// a separate use case. - case useCaseNearbyShareWithQrCode // = 7 + /// + /// NOTE: This enum value was marked as deprecated in the .proto file + case useCaseNearbyShareWithQrCode = 7 /// The user was redirected from Bluetooth sharing UI to Nearby Share - case useCaseRedirectedFromBluetoothShare // = 8 + case useCaseRedirectedFromBluetoothShare = 8 init() { self = .useCaseUnknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .useCaseUnknown - case 1: self = .useCaseNearbyShare - case 2: self = .useCaseRemoteCopyPaste - case 3: self = .useCaseWifiCredential - case 4: self = .useCaseAppShare - case 5: self = .useCaseQuickSettingFileShare - case 6: self = .useCaseSetupWizard - case 7: self = .useCaseNearbyShareWithQrCode - case 8: self = .useCaseRedirectedFromBluetoothShare - default: return nil - } - } - - var rawValue: Int { - switch self { - case .useCaseUnknown: return 0 - case .useCaseNearbyShare: return 1 - case .useCaseRemoteCopyPaste: return 2 - case .useCaseWifiCredential: return 3 - case .useCaseAppShare: return 4 - case .useCaseQuickSettingFileShare: return 5 - case .useCaseSetupWizard: return 6 - case .useCaseNearbyShareWithQrCode: return 7 - case .useCaseRedirectedFromBluetoothShare: return 8 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_SharingUseCase: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// Used only for Windows App now. -enum Location_Nearby_Proto_Sharing_AppCrashReason: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 +enum Location_Nearby_Proto_Sharing_AppCrashReason: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_AppCrashReason: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// Thes source where the attachemnt comes from. It can be an action, app name, /// etc. The first 6 source types are being used as FileSenderType in Nearby /// Share Windows app. -enum Location_Nearby_Proto_Sharing_AttachmentSourceType: SwiftProtobuf.Enum { - typealias RawValue = Int - case attachmentSourceUnknown // = 0 - case attachmentSourceContextMenu // = 1 - case attachmentSourceDragAndDrop // = 2 - case attachmentSourceSelectFilesButton // = 3 - case attachmentSourcePaste // = 4 - case attachmentSourceSelectFoldersButton // = 5 - case attachmentSourceShareActivation // = 6 +enum Location_Nearby_Proto_Sharing_AttachmentSourceType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case attachmentSourceUnknown = 0 + case attachmentSourceContextMenu = 1 + case attachmentSourceDragAndDrop = 2 + case attachmentSourceSelectFilesButton = 3 + case attachmentSourcePaste = 4 + case attachmentSourceSelectFoldersButton = 5 + case attachmentSourceShareActivation = 6 init() { self = .attachmentSourceUnknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .attachmentSourceUnknown - case 1: self = .attachmentSourceContextMenu - case 2: self = .attachmentSourceDragAndDrop - case 3: self = .attachmentSourceSelectFilesButton - case 4: self = .attachmentSourcePaste - case 5: self = .attachmentSourceSelectFoldersButton - case 6: self = .attachmentSourceShareActivation - default: return nil - } - } - - var rawValue: Int { - switch self { - case .attachmentSourceUnknown: return 0 - case .attachmentSourceContextMenu: return 1 - case .attachmentSourceDragAndDrop: return 2 - case .attachmentSourceSelectFilesButton: return 3 - case .attachmentSourcePaste: return 4 - case .attachmentSourceSelectFoldersButton: return 5 - case .attachmentSourceShareActivation: return 6 - } - } - } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_AttachmentSourceType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// The action to interact with preferences. /// Used only for Windows App now. -enum Location_Nearby_Proto_Sharing_PreferencesAction: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case noAction // = 1 +enum Location_Nearby_Proto_Sharing_PreferencesAction: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case noAction = 1 /// Primary actions/functions towards preferences - case loadPreferences // = 2 - case savePreferencess // = 3 - case attemptLoad // = 4 - case restoreFromBackup // = 5 + case loadPreferences = 2 + case savePreferencess = 3 + case attemptLoad = 4 + case restoreFromBackup = 5 /// Other actions within the 4 actions above - case createPreferencesPath // = 6 - case makePreferencesBackupFile // = 7 - case checkIfPreferencesPathExists // = 8 - case checkIfPreferencesInputStreamStatus // = 9 - case checkIfPreferencesFileIsCorrupted // = 10 - case checkIfPreferencesBackupFileExists // = 11 + case createPreferencesPath = 6 + case makePreferencesBackupFile = 7 + case checkIfPreferencesPathExists = 8 + case checkIfPreferencesInputStreamStatus = 9 + case checkIfPreferencesFileIsCorrupted = 10 + case checkIfPreferencesBackupFileExists = 11 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .noAction - case 2: self = .loadPreferences - case 3: self = .savePreferencess - case 4: self = .attemptLoad - case 5: self = .restoreFromBackup - case 6: self = .createPreferencesPath - case 7: self = .makePreferencesBackupFile - case 8: self = .checkIfPreferencesPathExists - case 9: self = .checkIfPreferencesInputStreamStatus - case 10: self = .checkIfPreferencesFileIsCorrupted - case 11: self = .checkIfPreferencesBackupFileExists - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .noAction: return 1 - case .loadPreferences: return 2 - case .savePreferencess: return 3 - case .attemptLoad: return 4 - case .restoreFromBackup: return 5 - case .createPreferencesPath: return 6 - case .makePreferencesBackupFile: return 7 - case .checkIfPreferencesPathExists: return 8 - case .checkIfPreferencesInputStreamStatus: return 9 - case .checkIfPreferencesFileIsCorrupted: return 10 - case .checkIfPreferencesBackupFileExists: return 11 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_PreferencesAction: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - /// The status of the action to interact with preferences. /// Used only for Windows App now. -enum Location_Nearby_Proto_Sharing_PreferencesActionStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case success // = 1 - case fail // = 2 +enum Location_Nearby_Proto_Sharing_PreferencesActionStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case success = 1 + case fail = 2 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .success - case 2: self = .fail - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .success: return 1 - case .fail: return 2 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - ///* The distance of the found nearby fast init advertisement. -enum Location_Nearby_Proto_Sharing_FastInitState: SwiftProtobuf.Enum { - typealias RawValue = Int - case fastInitUnknownState // = 0 +enum Location_Nearby_Proto_Sharing_FastInitState: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case fastInitUnknownState = 0 /// A device was found in close proximity. /// distance < fast_init_distance_close_centimeters(50 cm) - case fastInitCloseState // = 1 + case fastInitCloseState = 1 /// A device was found in far proximity. /// distance < fast_init_distance_close_centimeters(10 m) - case fastInitFarState // = 2 + case fastInitFarState = 2 /// No devices have been found nearby. The default state. - case fastInitLostState // = 3 + case fastInitLostState = 3 init() { self = .fastInitUnknownState } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .fastInitUnknownState - case 1: self = .fastInitCloseState - case 2: self = .fastInitFarState - case 3: self = .fastInitLostState - default: return nil - } - } - - var rawValue: Int { - switch self { - case .fastInitUnknownState: return 0 - case .fastInitCloseState: return 1 - case .fastInitFarState: return 2 - case .fastInitLostState: return 3 - } - } - -} - -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_FastInitState: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - ///* The type of FastInit advertisement. -enum Location_Nearby_Proto_Sharing_FastInitType: SwiftProtobuf.Enum { - typealias RawValue = Int - case fastInitUnknownType // = 0 +enum Location_Nearby_Proto_Sharing_FastInitType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case fastInitUnknownType = 0 /// Show HUN to notify the user. - case fastInitNotifyType // = 1 + case fastInitNotifyType = 1 /// Not notify the user. - case fastInitSilentType // = 2 + case fastInitSilentType = 2 init() { self = .fastInitUnknownType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .fastInitUnknownType - case 1: self = .fastInitNotifyType - case 2: self = .fastInitSilentType - default: return nil - } - } +} + +///* The type of desktop notification event. +enum Location_Nearby_Proto_Sharing_DesktopNotification: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case connecting = 1 + case progress = 2 + case accept = 3 + case received = 4 + case error = 5 - var rawValue: Int { - switch self { - case .fastInitUnknownType: return 0 - case .fastInitNotifyType: return 1 - case .fastInitSilentType: return 2 - } + init() { + self = .unknown } } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_FastInitType: CaseIterable { - // Support synthesized by the compiler. -} +enum Location_Nearby_Proto_Sharing_DesktopTransferEventType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 -#endif // swift(>=4.2) + /// Receive attachments. + case desktopTransferEventReceiveTypeAccept = 1 + case desktopTransferEventReceiveTypeProgress = 2 + case desktopTransferEventReceiveTypeReceived = 3 + case desktopTransferEventReceiveTypeError = 4 -///* The type of desktop notification event. -enum Location_Nearby_Proto_Sharing_DesktopNotification: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case connecting // = 1 - case progress // = 2 - case accept // = 3 - case received // = 4 - case error // = 5 + /// Send attachments. + case desktopTransferEventSendTypeStart = 5 + case desktopTransferEventSendTypeSelectADevice = 6 + case desktopTransferEventSendTypeProgress = 7 + case desktopTransferEventSendTypeSent = 8 + case desktopTransferEventSendTypeError = 9 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .connecting - case 2: self = .progress - case 3: self = .accept - case 4: self = .received - case 5: self = .error - default: return nil - } - } +} + +enum Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case decryptCertUnknownFailure = 0 + case decryptCertNoSuchAlgorithmFailure = 1 + case decryptCertNoSuchPaddingFailure = 2 + case decryptCertInvalidKeyFailure = 3 + case decryptCertInvalidAlgorithmParameterFailure = 4 + case decryptCertIllegalBlockSizeFailure = 5 + case decryptCertBadPaddingFailure = 6 - var rawValue: Int { - switch self { - case .unknown: return 0 - case .connecting: return 1 - case .progress: return 2 - case .accept: return 3 - case .received: return 4 - case .error: return 5 - } + init() { + self = .decryptCertUnknownFailure } } -#if swift(>=4.2) +/// Refer to go/qs-contacts-consent-2024 for the detail. +enum Location_Nearby_Proto_Sharing_ContactAccess: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case noContactUploaded = 1 + case onlyUploadGoogleContact = 2 + case uploadContactForDeviceContactConsent = 3 + case uploadContactForQuickShareConsent = 4 + + init() { + self = .unknown + } -extension Location_Nearby_Proto_Sharing_DesktopNotification: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) +/// Refer to go/qs-contacts-consent-2024 for the detail. +enum Location_Nearby_Proto_Sharing_IdentityVerification: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case noPhoneNumberVerified = 1 + case phoneNumberVerifiedNotLinkedToGaia = 2 + case phoneNumberVerifiedLinkedToQsGaia = 3 -enum Location_Nearby_Proto_Sharing_DesktopTransferEventType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 + init() { + self = .unknown + } - /// Receive attachments. - case desktopTransferEventReceiveTypeAccept // = 1 - case desktopTransferEventReceiveTypeProgress // = 2 - case desktopTransferEventReceiveTypeReceived // = 3 - case desktopTransferEventReceiveTypeError // = 4 +} - /// Send attachments. - case desktopTransferEventSendTypeStart // = 5 - case desktopTransferEventSendTypeSelectADevice // = 6 - case desktopTransferEventSendTypeProgress // = 7 - case desktopTransferEventSendTypeSent // = 8 - case desktopTransferEventSendTypeError // = 9 +enum Location_Nearby_Proto_Sharing_ButtonStatus: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case clickAccept = 1 + case clickReject = 2 + case ignore = 3 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .desktopTransferEventReceiveTypeAccept - case 2: self = .desktopTransferEventReceiveTypeProgress - case 3: self = .desktopTransferEventReceiveTypeReceived - case 4: self = .desktopTransferEventReceiveTypeError - case 5: self = .desktopTransferEventSendTypeStart - case 6: self = .desktopTransferEventSendTypeSelectADevice - case 7: self = .desktopTransferEventSendTypeProgress - case 8: self = .desktopTransferEventSendTypeSent - case 9: self = .desktopTransferEventSendTypeError - default: return nil - } - } +} - var rawValue: Int { - switch self { - case .unknown: return 0 - case .desktopTransferEventReceiveTypeAccept: return 1 - case .desktopTransferEventReceiveTypeProgress: return 2 - case .desktopTransferEventReceiveTypeReceived: return 3 - case .desktopTransferEventReceiveTypeError: return 4 - case .desktopTransferEventSendTypeStart: return 5 - case .desktopTransferEventSendTypeSelectADevice: return 6 - case .desktopTransferEventSendTypeProgress: return 7 - case .desktopTransferEventSendTypeSent: return 8 - case .desktopTransferEventSendTypeError: return 9 - } - } +// MARK: - Code below here is support for the SwiftProtobuf runtime. +nonisolated extension Location_Nearby_Proto_Sharing_EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_EVENT_TYPE\0\u{1}ACCEPT_AGREEMENTS\0\u{1}ENABLE_NEARBY_SHARING\0\u{1}SET_VISIBILITY\0\u{1}DESCRIBE_ATTACHMENTS\0\u{1}SCAN_FOR_SHARE_TARGETS_START\0\u{1}SCAN_FOR_SHARE_TARGETS_END\0\u{1}ADVERTISE_DEVICE_PRESENCE_START\0\u{1}ADVERTISE_DEVICE_PRESENCE_END\0\u{1}SEND_FAST_INITIALIZATION\0\u{1}RECEIVE_FAST_INITIALIZATION\0\u{1}DISCOVER_SHARE_TARGET\0\u{1}SEND_INTRODUCTION\0\u{1}RECEIVE_INTRODUCTION\0\u{1}RESPOND_TO_INTRODUCTION\0\u{1}SEND_ATTACHMENTS_START\0\u{1}SEND_ATTACHMENTS_END\0\u{1}RECEIVE_ATTACHMENTS_START\0\u{1}RECEIVE_ATTACHMENTS_END\0\u{1}CANCEL_SENDING_ATTACHMENTS\0\u{1}CANCEL_RECEIVING_ATTACHMENTS\0\u{1}OPEN_RECEIVED_ATTACHMENTS\0\u{1}LAUNCH_SETUP_ACTIVITY\0\u{1}ADD_CONTACT\0\u{1}REMOVE_CONTACT\0\u{1}FAST_SHARE_SERVER_RESPONSE\0\u{1}SEND_START\0\u{1}ACCEPT_FAST_INITIALIZATION\0\u{1}SET_DATA_USAGE\0\u{1}DISMISS_FAST_INITIALIZATION\0\u{1}CANCEL_CONNECTION\0\u{1}LAUNCH_ACTIVITY\0\u{1}DISMISS_PRIVACY_NOTIFICATION\0\u{1}TAP_PRIVACY_NOTIFICATION\0\u{1}TAP_HELP\0\u{1}TAP_FEEDBACK\0\u{1}ADD_QUICK_SETTINGS_TILE\0\u{1}REMOVE_QUICK_SETTINGS_TILE\0\u{1}LAUNCH_PHONE_CONSENT\0\u{1}TAP_QUICK_SETTINGS_TILE\0\u{1}INSTALL_APK\0\u{1}VERIFY_APK\0\u{1}LAUNCH_CONSENT\0\u{1}PROCESS_RECEIVED_ATTACHMENTS_END\0\u{1}TOGGLE_SHOW_NOTIFICATION\0\u{1}SET_DEVICE_NAME\0\u{1}DECLINE_AGREEMENTS\0\u{1}REQUEST_SETTING_PERMISSIONS\0\u{1}ESTABLISH_CONNECTION\0\u{1}DEVICE_SETTINGS\0\u{1}AUTO_DISMISS_FAST_INITIALIZATION\0\u{1}APP_CRASH\0\u{1}TAP_QUICK_SETTINGS_FILE_SHARE\0\u{1}DISPLAY_PRIVACY_NOTIFICATION\0\u{1}DISPLAY_PHONE_CONSENT\0\u{1}PREFERENCES_USAGE\0\u{1}DEFAULT_OPT_IN\0\u{1}SETUP_WIZARD\0\u{1}TAP_QR_CODE\0\u{1}QR_CODE_LINK_SHOWN\0\u{1}PARSING_FAILED_ENDPOINT_ID\0\u{1}FAST_INIT_DISCOVER_DEVICE\0\u{1}SEND_DESKTOP_NOTIFICATION\0\u{1}SET_ACCOUNT\0\u{1}DECRYPT_CERTIFICATE_FAILURE\0\u{1}SHOW_ALLOW_PERMISSION_AUTO_ACCESS\0\u{1}SEND_DESKTOP_TRANSFER_EVENT\0\u{1}WAITING_FOR_ACCEPT\0\u{1}HIGH_QUALITY_MEDIUM_SETUP\0\u{1}RPC_CALL_STATUS\0\u{1}START_QR_CODE_SESSION\0\u{1}QR_CODE_OPENED_IN_WEB_CLIENT\0\u{1}HATS_JOINT_EVENT\0\u{1}RECEIVE_PREVIEWS\0") } -#if swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_EventCategory: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_EVENT_CATEGORY\0\u{1}SENDING_EVENT\0\u{1}RECEIVING_EVENT\0\u{1}SETTINGS_EVENT\0\u{1}RPC_EVENT\0") +} -extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: CaseIterable { - // Support synthesized by the compiler. +nonisolated extension Location_Nearby_Proto_Sharing_NearbySharingStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_NEARBY_SHARING_STATUS\0\u{1}ON\0\u{1}OFF\0") } -#endif // swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_Visibility: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_VISIBILITY\0\u{1}CONTACTS_ONLY\0\u{1}EVERYONE\0\u{1}SELECTED_CONTACTS_ONLY\0\u{1}HIDDEN\0\u{1}SELF_SHARE\0") +} -enum Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case decryptCertUnknownFailure // = 0 - case decryptCertNoSuchAlgorithmFailure // = 1 - case decryptCertNoSuchPaddingFailure // = 2 - case decryptCertInvalidKeyFailure // = 3 - case decryptCertInvalidAlgorithmParameterFailure // = 4 - case decryptCertIllegalBlockSizeFailure // = 5 - case decryptCertBadPaddingFailure // = 6 +nonisolated extension Location_Nearby_Proto_Sharing_DataUsage: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_DATA_USAGE\0\u{1}ONLINE\0\u{1}WIFI_ONLY\0\u{1}OFFLINE\0") +} - init() { - self = .decryptCertUnknownFailure - } +nonisolated extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONNECTION_STATUS_UNKNOWN\0\u{1}CONNECTION_STATUS_SUCCESS\0\u{1}CONNECTION_STATUS_FAILURE\0\u{1}CONNECTION_STATUS_CANCELLATION\0\u{1}CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT\0\u{1}CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE\0\u{1}CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION\0\u{1}CONNECTION_STATUS_FAILED_NULL_CONNECTION\0\u{1}CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK\0\u{1}CONNECTION_STATUS_LOST_CONNECTIVITY\0\u{1}CONNECTION_STATUS_INVALID_ADVERTISEMENT\0") +} - init?(rawValue: Int) { - switch rawValue { - case 0: self = .decryptCertUnknownFailure - case 1: self = .decryptCertNoSuchAlgorithmFailure - case 2: self = .decryptCertNoSuchPaddingFailure - case 3: self = .decryptCertInvalidKeyFailure - case 4: self = .decryptCertInvalidAlgorithmParameterFailure - case 5: self = .decryptCertIllegalBlockSizeFailure - case 6: self = .decryptCertBadPaddingFailure - default: return nil - } - } +nonisolated extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}COMPLETE_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}CANCELED_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}FAILED_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}REJECTED_ATTACHMENT\0\u{1}TIMED_OUT_ATTACHMENT\0\u{1}AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT\0\u{1}NOT_ENOUGH_SPACE_ATTACHMENT\0\u{1}FAILED_NO_TRANSFER_UPDATE_CALLBACK\0\u{1}MEDIA_UNAVAILABLE_ATTACHMENT\0\u{1}UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT\0\u{1}NO_ATTACHMENT_FOUND\0\u{1}FAILED_NO_SHARE_TARGET_ENDPOINT\0\u{1}FAILED_PAIRED_KEYHANDSHAKE\0\u{1}FAILED_NULL_CONNECTION\0\u{1}FAILED_NO_PAYLOAD\0\u{1}FAILED_WRITE_INTRODUCTION\0\u{1}FAILED_UNKNOWN_REMOTE_RESPONSE\0\u{1}FAILED_NULL_CONNECTION_INIT_OUTGOING\0\u{1}FAILED_NULL_CONNECTION_DISCONNECTED\0\u{1}FAILED_NULL_CONNECTION_LOST_CONNECTIVITY\0\u{1}FAILED_NULL_CONNECTION_FAILURE\0\u{1}REJECTED_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS\0\u{1}FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS\0\u{1}NO_RESPONSE_FRAME_CONNECTION_CLOSED_LOST_CONNECTIVITY_TRANSMISSION_STATUS\0\u{1}NO_RESPONSE_FRAME_CONNECTION_CLOSED_TRANSMISSION_STATUS\0\u{1}LOST_CONNECTIVITY_TRANSMISSION_STATUS\0\u{1}FAILED_DISALLOWED_MEDIUM\0") +} - var rawValue: Int { - switch self { - case .decryptCertUnknownFailure: return 0 - case .decryptCertNoSuchAlgorithmFailure: return 1 - case .decryptCertNoSuchPaddingFailure: return 2 - case .decryptCertInvalidKeyFailure: return 3 - case .decryptCertInvalidAlgorithmParameterFailure: return 4 - case .decryptCertIllegalBlockSizeFailure: return 5 - case .decryptCertBadPaddingFailure: return 6 - } - } +nonisolated extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONNECTION_LAYER_STATUS_UNKNOWN\0\u{1}CONNECTION_LAYER_STATUS_SUCCESS\0\u{1}CONNECTION_LAYER_STATUS_ERROR\0\u{1}CONNECTION_LAYER_STATUS_OUT_OF_ORDER_API_CALL\0\u{1}CONNECTION_LAYER_STATUS_ALREADY_HAVE_ACTIVE_STRATEGY\0\u{1}CONNECTION_LAYER_STATUS_ALREADY_ADVERTISING\0\u{1}CONNECTION_LAYER_STATUS_ALREADY_DISCOVERING\0\u{1}CONNECTION_LAYER_STATUS_ALREADY_LISTENING\0\u{1}CONNECTION_LAYER_STATUS_END_POINT_IO_ERROR\0\u{1}CONNECTION_LAYER_STATUS_END_POINT_UNKNOWN\0\u{1}CONNECTION_LAYER_STATUS_CONNECTION_REJECTED\0\u{1}CONNECTION_LAYER_STATUS_ALREADY_CONNECTED_TO_END_POINT\0\u{1}CONNECTION_LAYER_STATUS_NOT_CONNECTED_TO_END_POINT\0\u{1}CONNECTION_LAYER_STATUS_BLUETOOTH_ERROR\0\u{1}CONNECTION_LAYER_STATUS_BLE_ERROR\0\u{1}CONNECTION_LAYER_STATUS_WIFI_LAN_ERROR\0\u{1}CONNECTION_LAYER_STATUS_PAYLOAD_UNKNOWN\0\u{1}CONNECTION_LAYER_STATUS_RESET\0\u{1}CONNECTION_LAYER_STATUS_TIMEOUT\0") +} +nonisolated extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PROCESSING_STATUS_UNKNOWN\0\u{1}PROCESSING_STATUS_COMPLETE_PROCESSING_ATTACHMENTS\0\u{1}PROCESSING_STATUS_FAILED_MOVING_FILES\0\u{1}PROCESSING_STATUS_FAILED_RECEIVING_APK\0\u{1}PROCESSING_STATUS_FAILED_RECEIVING_TEXT\0\u{1}PROCESSING_STATUS_FAILED_RECEIVING_WIFI_CREDENTIALS\0") } -#if swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_SessionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_SESSION_STATUS\0\u{1}SUCCEEDED_SESSION_STATUS\0\u{1}FAILED_SESSION_STATUS\0") +} -extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: CaseIterable { - // Support synthesized by the compiler. +nonisolated extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_RESPONSE_TO_INTRODUCTION\0\u{1}ACCEPT_INTRODUCTION\0\u{1}REJECT_INTRODUCTION\0\u{1}FAIL_INTRODUCTION\0") } -#endif // swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_DeviceType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_DEVICE_TYPE\0\u{1}PHONE\0\u{1}TABLET\0\u{1}LAPTOP\0\u{1}CAR\0\u{1}FOLDABLE\0\u{1}XR\0") +} -/// Refer to go/qs-contacts-consent-2024 for the detail. -enum Location_Nearby_Proto_Sharing_ContactAccess: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case noContactUploaded // = 1 - case onlyUploadGoogleContact // = 2 - case uploadContactForDeviceContactConsent // = 3 - case uploadContactForQuickShareConsent // = 4 +nonisolated extension Location_Nearby_Proto_Sharing_OSType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_OS_TYPE\0\u{1}ANDROID\0\u{1}CHROME_OS\0\u{1}IOS\0\u{1}WINDOWS\0\u{1}MACOS\0") +} - init() { - self = .unknown - } +nonisolated extension Location_Nearby_Proto_Sharing_DeviceRelationship: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_DEVICE_RELATIONSHIP\0\u{1}IS_SELF\0\u{1}IS_CONTACT\0\u{1}IS_STRANGER\0") +} - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .noContactUploaded - case 2: self = .onlyUploadGoogleContact - case 3: self = .uploadContactForDeviceContactConsent - case 4: self = .uploadContactForQuickShareConsent - default: return nil - } - } +nonisolated extension Location_Nearby_Proto_Sharing_LogSource: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNSPECIFIED_SOURCE\0\u{1}LAB_DEVICES\0\u{1}INTERNAL_DEVICES\0\u{1}BETA_TESTER_DEVICES\0\u{1}OEM_DEVICES\0\u{1}DEBUG_DEVICES\0\u{1}NEARBY_MODULE_FOOD_DEVICES\0\u{1}BETO_DOGFOOD_DEVICES\0\u{1}NEARBY_DOGFOOD_DEVICES\0\u{1}NEARBY_TEAMFOOD_DEVICES\0") +} - var rawValue: Int { - switch self { - case .unknown: return 0 - case .noContactUploaded: return 1 - case .onlyUploadGoogleContact: return 2 - case .uploadContactForDeviceContactConsent: return 3 - case .uploadContactForQuickShareConsent: return 4 - } - } +nonisolated extension Location_Nearby_Proto_Sharing_ServerActionName: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_SERVER_ACTION\0\u{1}UPLOAD_CERTIFICATES\0\u{1}DOWNLOAD_CERTIFICATES\0\u{1}CHECK_REACHABILITY\0\u{1}UPLOAD_CONTACTS\0\u{1}UPDATE_DEVICE_NAME\0\u{1}UPLOAD_SENDER_CERTIFICATES\0\u{1}DOWNLOAD_SENDER_CERTIFICATES\0\u{1}UPLOAD_CONTACTS_AND_CERTIFICATES\0\u{1}LIST_REACHABLE_PHONE_NUMBERS\0\u{1}LIST_MY_DEVICES\0\u{1}LIST_CONTACT_PEOPLE\0\u{1}DOWNLOAD_CERTIFICATES_INFO\0") +} +nonisolated extension Location_Nearby_Proto_Sharing_ServerResponseState: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_SERVER_RESPONSE_STATE\0\u{1}SERVER_RESPONSE_SUCCESS\0\u{1}SERVER_RESPONSE_UNKNOWN_FAILURE\0\u{1}SERVER_RESPONSE_STATUS_OTHER_FAILURE\0\u{1}SERVER_RESPONSE_STATUS_DEADLINE_EXCEEDED\0\u{1}SERVER_RESPONSE_STATUS_PERMISSION_DENIED\0\u{1}SERVER_RESPONSE_STATUS_UNAVAILABLE\0\u{1}SERVER_RESPONSE_STATUS_UNAUTHENTICATED\0\u{1}SERVER_RESPONSE_GOOGLE_AUTH_FAILURE\0\u{1}SERVER_RESPONSE_STATUS_INVALID_ARGUMENT\0\u{1}SERVER_RESPONSE_NOT_CONNECTED_TO_INTERNET\0") } -#if swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_SyncPurpose: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0SYNC_PURPOSE_UNKNOWN\0\u{1}SYNC_PURPOSE_ON_DEMAND_SYNC\0\u{1}SYNC_PURPOSE_CHIME_NOTIFICATION\0\u{1}SYNC_PURPOSE_DAILY_SYNC\0\u{1}SYNC_PURPOSE_OPT_IN_FIRST_SYNC\0\u{1}SYNC_PURPOSE_CHECK_DEFAULT_OPT_IN\0\u{1}SYNC_PURPOSE_NEARBY_SHARE_ENABLED\0\u{1}SYNC_PURPOSE_SYNC_AT_FAST_INIT\0\u{1}SYNC_PURPOSE_SYNC_AT_DISCOVERY\0\u{1}SYNC_PURPOSE_SYNC_AT_LOAD_PRIVATE_CERTIFICATE\0\u{1}SYNC_PURPOSE_SYNC_AT_ADVERTISEMENT\0\u{1}SYNC_PURPOSE_CONTACT_LIST_CHANGE\0\u{1}SYNC_PURPOSE_SHOW_C11N_VIEW\0\u{1}SYNC_PURPOSE_REGULAR_CHECK_CONTACT_REACHABILITY\0\u{1}SYNC_PURPOSE_VISIBILITY_SELECTED_CONTACT_CHANGE\0\u{1}SYNC_PURPOSE_ACCOUNT_CHANGE\0\u{1}SYNC_PURPOSE_REGENERATE_CERTIFICATES\0\u{1}SYNC_PURPOSE_DEVICE_CONTACTS_CONSENT_CHANGE\0") +} -extension Location_Nearby_Proto_Sharing_ContactAccess: CaseIterable { - // Support synthesized by the compiler. +nonisolated extension Location_Nearby_Proto_Sharing_ClientRole: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CLIENT_ROLE_UNKNOWN\0\u{1}CLIENT_ROLE_SENDER\0\u{1}CLIENT_ROLE_RECEIVER\0") } -#endif // swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_ScanType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_SCAN_TYPE\0\u{1}FOREGROUND_SCAN\0\u{1}FOREGROUND_RETRY_SCAN\0\u{1}DIRECT_SHARE_SCAN\0\u{1}BACKGROUND_SCAN\0") +} -/// Refer to go/qs-contacts-consent-2024 for the detail. -enum Location_Nearby_Proto_Sharing_IdentityVerification: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case noPhoneNumberVerified // = 1 - case phoneNumberVerifiedNotLinkedToGaia // = 2 - case phoneNumberVerifiedLinkedToQsGaia // = 3 +nonisolated extension Location_Nearby_Proto_Sharing_ParsingFailedType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0FAILED_UNKNOWN_TYPE\0\u{1}FAILED_PARSE_ADVERTISEMENT\0\u{1}FAILED_CONVERT_SHARE_TARGET\0") +} - init() { - self = .unknown - } +nonisolated extension Location_Nearby_Proto_Sharing_AdvertisingMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_ADVERTISING_MODE\0\u{1}SCREEN_OFF_ADVERTISING_MODE\0\u{1}BACKGROUND_ADVERTISING_MODE\0\u{1}MIDGROUND_ADVERTISING_MODE\0\u{1}FOREGROUND_ADVERTISING_MODE\0\u{1}SUSPENDED_ADVERTISING_MODE\0") +} - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .noPhoneNumberVerified - case 2: self = .phoneNumberVerifiedNotLinkedToGaia - case 3: self = .phoneNumberVerifiedLinkedToQsGaia - default: return nil - } - } +nonisolated extension Location_Nearby_Proto_Sharing_DiscoveryMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_DISCOVERY_MODE\0\u{1}SCREEN_OFF_DISCOVERY_MODE\0\u{1}BACKGROUND_DISCOVERY_MODE\0\u{1}MIDGROUND_DISCOVERY_MODE\0\u{1}FOREGROUND_DISCOVERY_MODE\0\u{1}SUSPENDED_DISCOVERY_MODE\0") +} - var rawValue: Int { - switch self { - case .unknown: return 0 - case .noPhoneNumberVerified: return 1 - case .phoneNumberVerifiedNotLinkedToGaia: return 2 - case .phoneNumberVerifiedLinkedToQsGaia: return 3 - } - } +nonisolated extension Location_Nearby_Proto_Sharing_ActivityName: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_ACTIVITY\0\u{1}SHARE_SHEET_ACTIVITY\0\u{1}SETTINGS_ACTIVITY\0\u{1}RECEIVE_SURFACE_ACTIVITY\0\u{1}SETUP_ACTIVITY\0\u{1}DEVICE_VISIBILITY_ACTIVITY\0\u{1}CONSENTS_ACTIVITY\0\u{1}SET_DEVICE_NAME_DIALOG\0\u{1}SET_DATA_USAGE_DIALOG\0\u{1}QUICK_SETTINGS_ACTIVITY\0\u{1}REMOTE_COPY_SHARE_SHEET_ACTIVITY\0\u{1}SETUP_WIZARD_ACTIVITY\0\u{1}SETTINGS_REVIEW_ACTIVITY\0") +} +nonisolated extension Location_Nearby_Proto_Sharing_ConsentType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONSENT_TYPE_UNKNOWN\0\u{1}CONSENT_TYPE_C11N\0\u{1}CONSENT_TYPE_DEVICE_CONTACT\0") } -#if swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONSENT_UNKNOWN_ACCEPT_STATUS\0\u{1}CONSENT_ACCEPTED\0\u{1}CONSENT_DECLINED\0\u{1}CONSENT_UNABLE_TO_ENABLE\0") +} -extension Location_Nearby_Proto_Sharing_IdentityVerification: CaseIterable { - // Support synthesized by the compiler. +nonisolated extension Location_Nearby_Proto_Sharing_ApkSource: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_APK_SOURCE\0\u{1}APK_FROM_SD_CARD\0\u{1}INSTALLED_APP\0") } -#endif // swift(>=4.2) +nonisolated extension Location_Nearby_Proto_Sharing_InstallAPKStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_INSTALL_APK_STATUS\0\u{1}FAIL_INSTALLATION\0\u{1}SUCCESS_INSTALLATION\0") +} -enum Location_Nearby_Proto_Sharing_ButtonStatus: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case clickAccept // = 1 - case clickReject // = 2 - case ignore // = 3 +nonisolated extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_VERIFY_APK_STATUS\0\u{1}NOT_INSTALLABLE\0\u{1}INSTALLABLE\0\u{1}ALREADY_INSTALLED\0") +} - init() { - self = .unknown - } +nonisolated extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_SHOW_NOTIFICATION_STATUS\0\u{1}SHOW\0\u{1}NOT_SHOW\0") +} - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .clickAccept - case 2: self = .clickReject - case 3: self = .ignore - default: return nil - } - } +nonisolated extension Location_Nearby_Proto_Sharing_PermissionRequestResult: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PERMISSION_UNKNOWN_REQUEST_RESULT\0\u{1}PERMISSION_GRANTED\0\u{1}PERMISSION_REJECTED\0\u{1}PERMISSION_UNABLE_TO_GRANT\0") +} - var rawValue: Int { - switch self { - case .unknown: return 0 - case .clickAccept: return 1 - case .clickReject: return 2 - case .ignore: return 3 - } - } +nonisolated extension Location_Nearby_Proto_Sharing_PermissionRequestType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PERMISSION_UNKNOWN_TYPE\0\u{1}PERMISSION_AIRPLANE_MODE_OFF\0\u{1}PERMISSION_WIFI\0\u{1}PERMISSION_BLUETOOTH\0\u{1}PERMISSION_LOCATION\0\u{1}PERMISSION_WIFI_HOTSPOT\0") +} +nonisolated extension Location_Nearby_Proto_Sharing_SharingUseCase: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0USE_CASE_UNKNOWN\0\u{1}USE_CASE_NEARBY_SHARE\0\u{1}USE_CASE_REMOTE_COPY_PASTE\0\u{1}USE_CASE_WIFI_CREDENTIAL\0\u{1}USE_CASE_APP_SHARE\0\u{1}USE_CASE_QUICK_SETTING_FILE_SHARE\0\u{1}USE_CASE_SETUP_WIZARD\0\u{1}USE_CASE_NEARBY_SHARE_WITH_QR_CODE\0\u{1}USE_CASE_REDIRECTED_FROM_BLUETOOTH_SHARE\0") } -#if swift(>=4.2) - -extension Location_Nearby_Proto_Sharing_ButtonStatus: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -#if swift(>=5.5) && canImport(_Concurrency) -extension Location_Nearby_Proto_Sharing_EventType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_EventCategory: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_NearbySharingStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_Visibility: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DataUsage: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_SessionStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DeviceType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_OSType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DeviceRelationship: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_LogSource: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ServerActionName: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ServerResponseState: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_SyncPurpose: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ClientRole: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ScanType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ParsingFailedType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_AdvertisingMode: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DiscoveryMode: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ActivityName: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ConsentType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ApkSource: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_InstallAPKStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_PermissionRequestResult: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_PermissionRequestType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_SharingUseCase: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_AppCrashReason: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_AttachmentSourceType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_PreferencesAction: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_FastInitState: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_FastInitType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DesktopNotification: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ContactAccess: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_IdentityVerification: @unchecked Sendable {} -extension Location_Nearby_Proto_Sharing_ButtonStatus: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) +nonisolated extension Location_Nearby_Proto_Sharing_AppCrashReason: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0APP_CRASH_REASON_UNKNOWN\0") +} -// MARK: - Code below here is support for the SwiftProtobuf runtime. +nonisolated extension Location_Nearby_Proto_Sharing_AttachmentSourceType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0ATTACHMENT_SOURCE_UNKNOWN\0\u{1}ATTACHMENT_SOURCE_CONTEXT_MENU\0\u{1}ATTACHMENT_SOURCE_DRAG_AND_DROP\0\u{1}ATTACHMENT_SOURCE_SELECT_FILES_BUTTON\0\u{1}ATTACHMENT_SOURCE_PASTE\0\u{1}ATTACHMENT_SOURCE_SELECT_FOLDERS_BUTTON\0\u{1}ATTACHMENT_SOURCE_SHARE_ACTIVATION\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_PreferencesAction: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PREFERENCES_ACTION_UNKNOWN\0\u{1}PREFERENCES_ACTION_NO_ACTION\0\u{1}PREFERENCES_ACTION_LOAD_PREFERENCES\0\u{1}PREFERENCES_ACTION_SAVE_PREFERENCESS\0\u{1}PREFERENCES_ACTION_ATTEMPT_LOAD\0\u{1}PREFERENCES_ACTION_RESTORE_FROM_BACKUP\0\u{1}PREFERENCES_ACTION_CREATE_PREFERENCES_PATH\0\u{1}PREFERENCES_ACTION_MAKE_PREFERENCES_BACKUP_FILE\0\u{1}PREFERENCES_ACTION_CHECK_IF_PREFERENCES_PATH_EXISTS\0\u{1}PREFERENCES_ACTION_CHECK_IF_PREFERENCES_INPUT_STREAM_STATUS\0\u{1}PREFERENCES_ACTION_CHECK_IF_PREFERENCES_FILE_IS_CORRUPTED\0\u{1}PREFERENCES_ACTION_CHECK_IF_PREFERENCES_BACKUP_FILE_EXISTS\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PREFERENCES_ACTION_STATUS_UNKNOWN\0\u{1}PREFERENCES_ACTION_STATUS_SUCCESS\0\u{1}PREFERENCES_ACTION_STATUS_FAIL\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_FastInitState: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0FAST_INIT_UNKNOWN_STATE\0\u{1}FAST_INIT_CLOSE_STATE\0\u{1}FAST_INIT_FAR_STATE\0\u{1}FAST_INIT_LOST_STATE\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_FastInitType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0FAST_INIT_UNKNOWN_TYPE\0\u{1}FAST_INIT_NOTIFY_TYPE\0\u{1}FAST_INIT_SILENT_TYPE\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_DesktopNotification: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DESKTOP_NOTIFICATION_UNKNOWN\0\u{1}DESKTOP_NOTIFICATION_CONNECTING\0\u{1}DESKTOP_NOTIFICATION_PROGRESS\0\u{1}DESKTOP_NOTIFICATION_ACCEPT\0\u{1}DESKTOP_NOTIFICATION_RECEIVED\0\u{1}DESKTOP_NOTIFICATION_ERROR\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN\0\u{1}DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ACCEPT\0\u{1}DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_PROGRESS\0\u{1}DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_RECEIVED\0\u{1}DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ERROR\0\u{1}DESKTOP_TRANSFER_EVENT_SEND_TYPE_START\0\u{1}DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE\0\u{1}DESKTOP_TRANSFER_EVENT_SEND_TYPE_PROGRESS\0\u{1}DESKTOP_TRANSFER_EVENT_SEND_TYPE_SENT\0\u{1}DESKTOP_TRANSFER_EVENT_SEND_TYPE_ERROR\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DECRYPT_CERT_UNKNOWN_FAILURE\0\u{1}DECRYPT_CERT_NO_SUCH_ALGORITHM_FAILURE\0\u{1}DECRYPT_CERT_NO_SUCH_PADDING_FAILURE\0\u{1}DECRYPT_CERT_INVALID_KEY_FAILURE\0\u{1}DECRYPT_CERT_INVALID_ALGORITHM_PARAMETER_FAILURE\0\u{1}DECRYPT_CERT_ILLEGAL_BLOCK_SIZE_FAILURE\0\u{1}DECRYPT_CERT_BAD_PADDING_FAILURE\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_ContactAccess: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CONTACT_ACCESS_UNKNOWN\0\u{1}CONTACT_ACCESS_NO_CONTACT_UPLOADED\0\u{1}CONTACT_ACCESS_ONLY_UPLOAD_GOOGLE_CONTACT\0\u{1}CONTACT_ACCESS_UPLOAD_CONTACT_FOR_DEVICE_CONTACT_CONSENT\0\u{1}CONTACT_ACCESS_UPLOAD_CONTACT_FOR_QUICK_SHARE_CONSENT\0") +} + +nonisolated extension Location_Nearby_Proto_Sharing_IdentityVerification: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0IDENTITY_VERIFICATION_UNKNOWN\0\u{1}IDENTITY_VERIFICATION_NO_PHONE_NUMBER_VERIFIED\0\u{1}IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_NOT_LINKED_TO_GAIA\0\u{1}IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_LINKED_TO_QS_GAIA\0") +} -extension Location_Nearby_Proto_Sharing_EventType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_EVENT_TYPE"), - 1: .same(proto: "ACCEPT_AGREEMENTS"), - 2: .same(proto: "ENABLE_NEARBY_SHARING"), - 3: .same(proto: "SET_VISIBILITY"), - 4: .same(proto: "DESCRIBE_ATTACHMENTS"), - 5: .same(proto: "SCAN_FOR_SHARE_TARGETS_START"), - 6: .same(proto: "SCAN_FOR_SHARE_TARGETS_END"), - 7: .same(proto: "ADVERTISE_DEVICE_PRESENCE_START"), - 8: .same(proto: "ADVERTISE_DEVICE_PRESENCE_END"), - 9: .same(proto: "SEND_FAST_INITIALIZATION"), - 10: .same(proto: "RECEIVE_FAST_INITIALIZATION"), - 11: .same(proto: "DISCOVER_SHARE_TARGET"), - 12: .same(proto: "SEND_INTRODUCTION"), - 13: .same(proto: "RECEIVE_INTRODUCTION"), - 14: .same(proto: "RESPOND_TO_INTRODUCTION"), - 15: .same(proto: "SEND_ATTACHMENTS_START"), - 16: .same(proto: "SEND_ATTACHMENTS_END"), - 17: .same(proto: "RECEIVE_ATTACHMENTS_START"), - 18: .same(proto: "RECEIVE_ATTACHMENTS_END"), - 19: .same(proto: "CANCEL_SENDING_ATTACHMENTS"), - 20: .same(proto: "CANCEL_RECEIVING_ATTACHMENTS"), - 21: .same(proto: "OPEN_RECEIVED_ATTACHMENTS"), - 22: .same(proto: "LAUNCH_SETUP_ACTIVITY"), - 23: .same(proto: "ADD_CONTACT"), - 24: .same(proto: "REMOVE_CONTACT"), - 25: .same(proto: "FAST_SHARE_SERVER_RESPONSE"), - 26: .same(proto: "SEND_START"), - 27: .same(proto: "ACCEPT_FAST_INITIALIZATION"), - 28: .same(proto: "SET_DATA_USAGE"), - 29: .same(proto: "DISMISS_FAST_INITIALIZATION"), - 30: .same(proto: "CANCEL_CONNECTION"), - 31: .same(proto: "LAUNCH_ACTIVITY"), - 32: .same(proto: "DISMISS_PRIVACY_NOTIFICATION"), - 33: .same(proto: "TAP_PRIVACY_NOTIFICATION"), - 34: .same(proto: "TAP_HELP"), - 35: .same(proto: "TAP_FEEDBACK"), - 36: .same(proto: "ADD_QUICK_SETTINGS_TILE"), - 37: .same(proto: "REMOVE_QUICK_SETTINGS_TILE"), - 38: .same(proto: "LAUNCH_PHONE_CONSENT"), - 39: .same(proto: "TAP_QUICK_SETTINGS_TILE"), - 40: .same(proto: "INSTALL_APK"), - 41: .same(proto: "VERIFY_APK"), - 42: .same(proto: "LAUNCH_CONSENT"), - 43: .same(proto: "PROCESS_RECEIVED_ATTACHMENTS_END"), - 44: .same(proto: "TOGGLE_SHOW_NOTIFICATION"), - 45: .same(proto: "SET_DEVICE_NAME"), - 46: .same(proto: "DECLINE_AGREEMENTS"), - 47: .same(proto: "REQUEST_SETTING_PERMISSIONS"), - 48: .same(proto: "ESTABLISH_CONNECTION"), - 49: .same(proto: "DEVICE_SETTINGS"), - 50: .same(proto: "AUTO_DISMISS_FAST_INITIALIZATION"), - 51: .same(proto: "APP_CRASH"), - 52: .same(proto: "TAP_QUICK_SETTINGS_FILE_SHARE"), - 53: .same(proto: "DISPLAY_PRIVACY_NOTIFICATION"), - 54: .same(proto: "DISPLAY_PHONE_CONSENT"), - 55: .same(proto: "PREFERENCES_USAGE"), - 56: .same(proto: "DEFAULT_OPT_IN"), - 57: .same(proto: "SETUP_WIZARD"), - 58: .same(proto: "TAP_QR_CODE"), - 59: .same(proto: "QR_CODE_LINK_SHOWN"), - 60: .same(proto: "PARSING_FAILED_ENDPOINT_ID"), - 61: .same(proto: "FAST_INIT_DISCOVER_DEVICE"), - 62: .same(proto: "SEND_DESKTOP_NOTIFICATION"), - 63: .same(proto: "SET_ACCOUNT"), - 64: .same(proto: "DECRYPT_CERTIFICATE_FAILURE"), - 65: .same(proto: "SHOW_ALLOW_PERMISSION_AUTO_ACCESS"), - 66: .same(proto: "SEND_DESKTOP_TRANSFER_EVENT"), - 67: .same(proto: "WAITING_FOR_ACCEPT"), - 68: .same(proto: "HIGH_QUALITY_MEDIUM_SETUP"), - 69: .same(proto: "RPC_CALL_STATUS"), - 70: .same(proto: "START_QR_CODE_SESSION"), - 71: .same(proto: "QR_CODE_OPENED_IN_WEB_CLIENT"), - 72: .same(proto: "HATS_JOINT_EVENT"), - 73: .same(proto: "RECEIVE_PREVIEWS"), - ] -} - -extension Location_Nearby_Proto_Sharing_EventCategory: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_EVENT_CATEGORY"), - 1: .same(proto: "SENDING_EVENT"), - 2: .same(proto: "RECEIVING_EVENT"), - 3: .same(proto: "SETTINGS_EVENT"), - 4: .same(proto: "RPC_EVENT"), - ] -} - -extension Location_Nearby_Proto_Sharing_NearbySharingStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_NEARBY_SHARING_STATUS"), - 1: .same(proto: "ON"), - 2: .same(proto: "OFF"), - ] -} - -extension Location_Nearby_Proto_Sharing_Visibility: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_VISIBILITY"), - 1: .same(proto: "CONTACTS_ONLY"), - 2: .same(proto: "EVERYONE"), - 3: .same(proto: "SELECTED_CONTACTS_ONLY"), - 4: .same(proto: "HIDDEN"), - 5: .same(proto: "SELF_SHARE"), - ] -} - -extension Location_Nearby_Proto_Sharing_DataUsage: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_DATA_USAGE"), - 1: .same(proto: "ONLINE"), - 2: .same(proto: "WIFI_ONLY"), - 3: .same(proto: "OFFLINE"), - ] -} - -extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONNECTION_STATUS_UNKNOWN"), - 1: .same(proto: "CONNECTION_STATUS_SUCCESS"), - 2: .same(proto: "CONNECTION_STATUS_FAILURE"), - 3: .same(proto: "CONNECTION_STATUS_CANCELLATION"), - 4: .same(proto: "CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT"), - 5: .same(proto: "CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE"), - 6: .same(proto: "CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION"), - 7: .same(proto: "CONNECTION_STATUS_FAILED_NULL_CONNECTION"), - 8: .same(proto: "CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK"), - 9: .same(proto: "CONNECTION_STATUS_LOST_CONNECTIVITY"), - 10: .same(proto: "CONNECTION_STATUS_INVALID_ADVERTISEMENT"), - ] -} - -extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS"), - 1: .same(proto: "COMPLETE_ATTACHMENT_TRANSMISSION_STATUS"), - 2: .same(proto: "CANCELED_ATTACHMENT_TRANSMISSION_STATUS"), - 3: .same(proto: "FAILED_ATTACHMENT_TRANSMISSION_STATUS"), - 4: .same(proto: "REJECTED_ATTACHMENT"), - 5: .same(proto: "TIMED_OUT_ATTACHMENT"), - 6: .same(proto: "AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT"), - 7: .same(proto: "NOT_ENOUGH_SPACE_ATTACHMENT"), - 8: .same(proto: "FAILED_NO_TRANSFER_UPDATE_CALLBACK"), - 9: .same(proto: "MEDIA_UNAVAILABLE_ATTACHMENT"), - 10: .same(proto: "UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT"), - 11: .same(proto: "NO_ATTACHMENT_FOUND"), - 12: .same(proto: "FAILED_NO_SHARE_TARGET_ENDPOINT"), - 13: .same(proto: "FAILED_PAIRED_KEYHANDSHAKE"), - 14: .same(proto: "FAILED_NULL_CONNECTION"), - 15: .same(proto: "FAILED_NO_PAYLOAD"), - 16: .same(proto: "FAILED_WRITE_INTRODUCTION"), - 17: .same(proto: "FAILED_UNKNOWN_REMOTE_RESPONSE"), - 18: .same(proto: "FAILED_NULL_CONNECTION_INIT_OUTGOING"), - 19: .same(proto: "FAILED_NULL_CONNECTION_DISCONNECTED"), - 20: .same(proto: "FAILED_NULL_CONNECTION_LOST_CONNECTIVITY"), - 21: .same(proto: "FAILED_NULL_CONNECTION_FAILURE"), - 22: .same(proto: "REJECTED_ATTACHMENT_TRANSMISSION_STATUS"), - 23: .same(proto: "TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS"), - 24: .same(proto: "NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS"), - 25: .same(proto: "UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS"), - 26: .same(proto: "FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS"), - 27: .same(proto: "NO_RESPONSE_FRAME_CONNECTION_CLOSED_LOST_CONNECTIVITY_TRANSMISSION_STATUS"), - 28: .same(proto: "NO_RESPONSE_FRAME_CONNECTION_CLOSED_TRANSMISSION_STATUS"), - 29: .same(proto: "LOST_CONNECTIVITY_TRANSMISSION_STATUS"), - 30: .same(proto: "FAILED_DISALLOWED_MEDIUM"), - ] -} - -extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONNECTION_LAYER_STATUS_UNKNOWN"), - 1: .same(proto: "CONNECTION_LAYER_STATUS_SUCCESS"), - 2: .same(proto: "CONNECTION_LAYER_STATUS_ERROR"), - 3: .same(proto: "CONNECTION_LAYER_STATUS_OUT_OF_ORDER_API_CALL"), - 4: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_HAVE_ACTIVE_STRATEGY"), - 5: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_ADVERTISING"), - 6: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_DISCOVERING"), - 7: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_LISTENING"), - 8: .same(proto: "CONNECTION_LAYER_STATUS_END_POINT_IO_ERROR"), - 9: .same(proto: "CONNECTION_LAYER_STATUS_END_POINT_UNKNOWN"), - 10: .same(proto: "CONNECTION_LAYER_STATUS_CONNECTION_REJECTED"), - 11: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_CONNECTED_TO_END_POINT"), - 12: .same(proto: "CONNECTION_LAYER_STATUS_NOT_CONNECTED_TO_END_POINT"), - 13: .same(proto: "CONNECTION_LAYER_STATUS_BLUETOOTH_ERROR"), - 14: .same(proto: "CONNECTION_LAYER_STATUS_BLE_ERROR"), - 15: .same(proto: "CONNECTION_LAYER_STATUS_WIFI_LAN_ERROR"), - 16: .same(proto: "CONNECTION_LAYER_STATUS_PAYLOAD_UNKNOWN"), - 17: .same(proto: "CONNECTION_LAYER_STATUS_RESET"), - 18: .same(proto: "CONNECTION_LAYER_STATUS_TIMEOUT"), - ] -} - -extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PROCESSING_STATUS_UNKNOWN"), - 1: .same(proto: "PROCESSING_STATUS_COMPLETE_PROCESSING_ATTACHMENTS"), - 2: .same(proto: "PROCESSING_STATUS_FAILED_MOVING_FILES"), - 3: .same(proto: "PROCESSING_STATUS_FAILED_RECEIVING_APK"), - 4: .same(proto: "PROCESSING_STATUS_FAILED_RECEIVING_TEXT"), - 5: .same(proto: "PROCESSING_STATUS_FAILED_RECEIVING_WIFI_CREDENTIALS"), - ] -} - -extension Location_Nearby_Proto_Sharing_SessionStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_SESSION_STATUS"), - 1: .same(proto: "SUCCEEDED_SESSION_STATUS"), - 2: .same(proto: "FAILED_SESSION_STATUS"), - ] -} - -extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_RESPONSE_TO_INTRODUCTION"), - 1: .same(proto: "ACCEPT_INTRODUCTION"), - 2: .same(proto: "REJECT_INTRODUCTION"), - 3: .same(proto: "FAIL_INTRODUCTION"), - ] -} - -extension Location_Nearby_Proto_Sharing_DeviceType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_DEVICE_TYPE"), - 1: .same(proto: "PHONE"), - 2: .same(proto: "TABLET"), - 3: .same(proto: "LAPTOP"), - 4: .same(proto: "CAR"), - 5: .same(proto: "FOLDABLE"), - 6: .same(proto: "XR"), - ] -} - -extension Location_Nearby_Proto_Sharing_OSType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_OS_TYPE"), - 1: .same(proto: "ANDROID"), - 2: .same(proto: "CHROME_OS"), - 3: .same(proto: "IOS"), - 4: .same(proto: "WINDOWS"), - 5: .same(proto: "MACOS"), - ] -} - -extension Location_Nearby_Proto_Sharing_DeviceRelationship: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_DEVICE_RELATIONSHIP"), - 1: .same(proto: "IS_SELF"), - 2: .same(proto: "IS_CONTACT"), - 3: .same(proto: "IS_STRANGER"), - ] -} - -extension Location_Nearby_Proto_Sharing_LogSource: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNSPECIFIED_SOURCE"), - 1: .same(proto: "LAB_DEVICES"), - 2: .same(proto: "INTERNAL_DEVICES"), - 3: .same(proto: "BETA_TESTER_DEVICES"), - 4: .same(proto: "OEM_DEVICES"), - 5: .same(proto: "DEBUG_DEVICES"), - 6: .same(proto: "NEARBY_MODULE_FOOD_DEVICES"), - 7: .same(proto: "BETO_DOGFOOD_DEVICES"), - 8: .same(proto: "NEARBY_DOGFOOD_DEVICES"), - 9: .same(proto: "NEARBY_TEAMFOOD_DEVICES"), - ] -} - -extension Location_Nearby_Proto_Sharing_ServerActionName: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_SERVER_ACTION"), - 1: .same(proto: "UPLOAD_CERTIFICATES"), - 2: .same(proto: "DOWNLOAD_CERTIFICATES"), - 3: .same(proto: "CHECK_REACHABILITY"), - 4: .same(proto: "UPLOAD_CONTACTS"), - 5: .same(proto: "UPDATE_DEVICE_NAME"), - 6: .same(proto: "UPLOAD_SENDER_CERTIFICATES"), - 7: .same(proto: "DOWNLOAD_SENDER_CERTIFICATES"), - 8: .same(proto: "UPLOAD_CONTACTS_AND_CERTIFICATES"), - 9: .same(proto: "LIST_REACHABLE_PHONE_NUMBERS"), - 10: .same(proto: "LIST_MY_DEVICES"), - 11: .same(proto: "LIST_CONTACT_PEOPLE"), - 12: .same(proto: "DOWNLOAD_CERTIFICATES_INFO"), - ] -} - -extension Location_Nearby_Proto_Sharing_ServerResponseState: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_SERVER_RESPONSE_STATE"), - 1: .same(proto: "SERVER_RESPONSE_SUCCESS"), - 2: .same(proto: "SERVER_RESPONSE_UNKNOWN_FAILURE"), - 3: .same(proto: "SERVER_RESPONSE_STATUS_OTHER_FAILURE"), - 4: .same(proto: "SERVER_RESPONSE_STATUS_DEADLINE_EXCEEDED"), - 5: .same(proto: "SERVER_RESPONSE_STATUS_PERMISSION_DENIED"), - 6: .same(proto: "SERVER_RESPONSE_STATUS_UNAVAILABLE"), - 7: .same(proto: "SERVER_RESPONSE_STATUS_UNAUTHENTICATED"), - 8: .same(proto: "SERVER_RESPONSE_GOOGLE_AUTH_FAILURE"), - 9: .same(proto: "SERVER_RESPONSE_STATUS_INVALID_ARGUMENT"), - 10: .same(proto: "SERVER_RESPONSE_NOT_CONNECTED_TO_INTERNET"), - ] -} - -extension Location_Nearby_Proto_Sharing_SyncPurpose: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SYNC_PURPOSE_UNKNOWN"), - 1: .same(proto: "SYNC_PURPOSE_ON_DEMAND_SYNC"), - 2: .same(proto: "SYNC_PURPOSE_CHIME_NOTIFICATION"), - 3: .same(proto: "SYNC_PURPOSE_DAILY_SYNC"), - 4: .same(proto: "SYNC_PURPOSE_OPT_IN_FIRST_SYNC"), - 5: .same(proto: "SYNC_PURPOSE_CHECK_DEFAULT_OPT_IN"), - 6: .same(proto: "SYNC_PURPOSE_NEARBY_SHARE_ENABLED"), - 7: .same(proto: "SYNC_PURPOSE_SYNC_AT_FAST_INIT"), - 8: .same(proto: "SYNC_PURPOSE_SYNC_AT_DISCOVERY"), - 9: .same(proto: "SYNC_PURPOSE_SYNC_AT_LOAD_PRIVATE_CERTIFICATE"), - 10: .same(proto: "SYNC_PURPOSE_SYNC_AT_ADVERTISEMENT"), - 11: .same(proto: "SYNC_PURPOSE_CONTACT_LIST_CHANGE"), - 12: .same(proto: "SYNC_PURPOSE_SHOW_C11N_VIEW"), - 13: .same(proto: "SYNC_PURPOSE_REGULAR_CHECK_CONTACT_REACHABILITY"), - 14: .same(proto: "SYNC_PURPOSE_VISIBILITY_SELECTED_CONTACT_CHANGE"), - 15: .same(proto: "SYNC_PURPOSE_ACCOUNT_CHANGE"), - 16: .same(proto: "SYNC_PURPOSE_REGENERATE_CERTIFICATES"), - 17: .same(proto: "SYNC_PURPOSE_DEVICE_CONTACTS_CONSENT_CHANGE"), - ] -} - -extension Location_Nearby_Proto_Sharing_ClientRole: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CLIENT_ROLE_UNKNOWN"), - 1: .same(proto: "CLIENT_ROLE_SENDER"), - 2: .same(proto: "CLIENT_ROLE_RECEIVER"), - ] -} - -extension Location_Nearby_Proto_Sharing_ScanType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_SCAN_TYPE"), - 1: .same(proto: "FOREGROUND_SCAN"), - 2: .same(proto: "FOREGROUND_RETRY_SCAN"), - 3: .same(proto: "DIRECT_SHARE_SCAN"), - 4: .same(proto: "BACKGROUND_SCAN"), - ] -} - -extension Location_Nearby_Proto_Sharing_ParsingFailedType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FAILED_UNKNOWN_TYPE"), - 1: .same(proto: "FAILED_PARSE_ADVERTISEMENT"), - 2: .same(proto: "FAILED_CONVERT_SHARE_TARGET"), - ] -} - -extension Location_Nearby_Proto_Sharing_AdvertisingMode: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_ADVERTISING_MODE"), - 1: .same(proto: "SCREEN_OFF_ADVERTISING_MODE"), - 2: .same(proto: "BACKGROUND_ADVERTISING_MODE"), - 3: .same(proto: "MIDGROUND_ADVERTISING_MODE"), - 4: .same(proto: "FOREGROUND_ADVERTISING_MODE"), - 5: .same(proto: "SUSPENDED_ADVERTISING_MODE"), - ] -} - -extension Location_Nearby_Proto_Sharing_DiscoveryMode: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_DISCOVERY_MODE"), - 1: .same(proto: "SCREEN_OFF_DISCOVERY_MODE"), - 2: .same(proto: "BACKGROUND_DISCOVERY_MODE"), - 3: .same(proto: "MIDGROUND_DISCOVERY_MODE"), - 4: .same(proto: "FOREGROUND_DISCOVERY_MODE"), - 5: .same(proto: "SUSPENDED_DISCOVERY_MODE"), - ] -} - -extension Location_Nearby_Proto_Sharing_ActivityName: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_ACTIVITY"), - 1: .same(proto: "SHARE_SHEET_ACTIVITY"), - 2: .same(proto: "SETTINGS_ACTIVITY"), - 3: .same(proto: "RECEIVE_SURFACE_ACTIVITY"), - 4: .same(proto: "SETUP_ACTIVITY"), - 5: .same(proto: "DEVICE_VISIBILITY_ACTIVITY"), - 6: .same(proto: "CONSENTS_ACTIVITY"), - 7: .same(proto: "SET_DEVICE_NAME_DIALOG"), - 8: .same(proto: "SET_DATA_USAGE_DIALOG"), - 9: .same(proto: "QUICK_SETTINGS_ACTIVITY"), - 10: .same(proto: "REMOTE_COPY_SHARE_SHEET_ACTIVITY"), - 11: .same(proto: "SETUP_WIZARD_ACTIVITY"), - 12: .same(proto: "SETTINGS_REVIEW_ACTIVITY"), - ] -} - -extension Location_Nearby_Proto_Sharing_ConsentType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONSENT_TYPE_UNKNOWN"), - 1: .same(proto: "CONSENT_TYPE_C11N"), - 2: .same(proto: "CONSENT_TYPE_DEVICE_CONTACT"), - ] -} - -extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONSENT_UNKNOWN_ACCEPT_STATUS"), - 1: .same(proto: "CONSENT_ACCEPTED"), - 2: .same(proto: "CONSENT_DECLINED"), - 3: .same(proto: "CONSENT_UNABLE_TO_ENABLE"), - ] -} - -extension Location_Nearby_Proto_Sharing_ApkSource: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_APK_SOURCE"), - 1: .same(proto: "APK_FROM_SD_CARD"), - 2: .same(proto: "INSTALLED_APP"), - ] -} - -extension Location_Nearby_Proto_Sharing_InstallAPKStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_INSTALL_APK_STATUS"), - 1: .same(proto: "FAIL_INSTALLATION"), - 2: .same(proto: "SUCCESS_INSTALLATION"), - ] -} - -extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_VERIFY_APK_STATUS"), - 1: .same(proto: "NOT_INSTALLABLE"), - 2: .same(proto: "INSTALLABLE"), - 3: .same(proto: "ALREADY_INSTALLED"), - ] -} - -extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_SHOW_NOTIFICATION_STATUS"), - 1: .same(proto: "SHOW"), - 2: .same(proto: "NOT_SHOW"), - ] -} - -extension Location_Nearby_Proto_Sharing_PermissionRequestResult: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PERMISSION_UNKNOWN_REQUEST_RESULT"), - 1: .same(proto: "PERMISSION_GRANTED"), - 2: .same(proto: "PERMISSION_REJECTED"), - 3: .same(proto: "PERMISSION_UNABLE_TO_GRANT"), - ] -} - -extension Location_Nearby_Proto_Sharing_PermissionRequestType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PERMISSION_UNKNOWN_TYPE"), - 1: .same(proto: "PERMISSION_AIRPLANE_MODE_OFF"), - 2: .same(proto: "PERMISSION_WIFI"), - 3: .same(proto: "PERMISSION_BLUETOOTH"), - 4: .same(proto: "PERMISSION_LOCATION"), - 5: .same(proto: "PERMISSION_WIFI_HOTSPOT"), - ] -} - -extension Location_Nearby_Proto_Sharing_SharingUseCase: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "USE_CASE_UNKNOWN"), - 1: .same(proto: "USE_CASE_NEARBY_SHARE"), - 2: .same(proto: "USE_CASE_REMOTE_COPY_PASTE"), - 3: .same(proto: "USE_CASE_WIFI_CREDENTIAL"), - 4: .same(proto: "USE_CASE_APP_SHARE"), - 5: .same(proto: "USE_CASE_QUICK_SETTING_FILE_SHARE"), - 6: .same(proto: "USE_CASE_SETUP_WIZARD"), - 7: .same(proto: "USE_CASE_NEARBY_SHARE_WITH_QR_CODE"), - 8: .same(proto: "USE_CASE_REDIRECTED_FROM_BLUETOOTH_SHARE"), - ] -} - -extension Location_Nearby_Proto_Sharing_AppCrashReason: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "APP_CRASH_REASON_UNKNOWN"), - ] -} - -extension Location_Nearby_Proto_Sharing_AttachmentSourceType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ATTACHMENT_SOURCE_UNKNOWN"), - 1: .same(proto: "ATTACHMENT_SOURCE_CONTEXT_MENU"), - 2: .same(proto: "ATTACHMENT_SOURCE_DRAG_AND_DROP"), - 3: .same(proto: "ATTACHMENT_SOURCE_SELECT_FILES_BUTTON"), - 4: .same(proto: "ATTACHMENT_SOURCE_PASTE"), - 5: .same(proto: "ATTACHMENT_SOURCE_SELECT_FOLDERS_BUTTON"), - 6: .same(proto: "ATTACHMENT_SOURCE_SHARE_ACTIVATION"), - ] -} - -extension Location_Nearby_Proto_Sharing_PreferencesAction: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PREFERENCES_ACTION_UNKNOWN"), - 1: .same(proto: "PREFERENCES_ACTION_NO_ACTION"), - 2: .same(proto: "PREFERENCES_ACTION_LOAD_PREFERENCES"), - 3: .same(proto: "PREFERENCES_ACTION_SAVE_PREFERENCESS"), - 4: .same(proto: "PREFERENCES_ACTION_ATTEMPT_LOAD"), - 5: .same(proto: "PREFERENCES_ACTION_RESTORE_FROM_BACKUP"), - 6: .same(proto: "PREFERENCES_ACTION_CREATE_PREFERENCES_PATH"), - 7: .same(proto: "PREFERENCES_ACTION_MAKE_PREFERENCES_BACKUP_FILE"), - 8: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_PATH_EXISTS"), - 9: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_INPUT_STREAM_STATUS"), - 10: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_FILE_IS_CORRUPTED"), - 11: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_BACKUP_FILE_EXISTS"), - ] -} - -extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PREFERENCES_ACTION_STATUS_UNKNOWN"), - 1: .same(proto: "PREFERENCES_ACTION_STATUS_SUCCESS"), - 2: .same(proto: "PREFERENCES_ACTION_STATUS_FAIL"), - ] -} - -extension Location_Nearby_Proto_Sharing_FastInitState: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FAST_INIT_UNKNOWN_STATE"), - 1: .same(proto: "FAST_INIT_CLOSE_STATE"), - 2: .same(proto: "FAST_INIT_FAR_STATE"), - 3: .same(proto: "FAST_INIT_LOST_STATE"), - ] -} - -extension Location_Nearby_Proto_Sharing_FastInitType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FAST_INIT_UNKNOWN_TYPE"), - 1: .same(proto: "FAST_INIT_NOTIFY_TYPE"), - 2: .same(proto: "FAST_INIT_SILENT_TYPE"), - ] -} - -extension Location_Nearby_Proto_Sharing_DesktopNotification: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DESKTOP_NOTIFICATION_UNKNOWN"), - 1: .same(proto: "DESKTOP_NOTIFICATION_CONNECTING"), - 2: .same(proto: "DESKTOP_NOTIFICATION_PROGRESS"), - 3: .same(proto: "DESKTOP_NOTIFICATION_ACCEPT"), - 4: .same(proto: "DESKTOP_NOTIFICATION_RECEIVED"), - 5: .same(proto: "DESKTOP_NOTIFICATION_ERROR"), - ] -} - -extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN"), - 1: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ACCEPT"), - 2: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_PROGRESS"), - 3: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_RECEIVED"), - 4: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ERROR"), - 5: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_START"), - 6: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE"), - 7: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_PROGRESS"), - 8: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_SENT"), - 9: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_ERROR"), - ] -} - -extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DECRYPT_CERT_UNKNOWN_FAILURE"), - 1: .same(proto: "DECRYPT_CERT_NO_SUCH_ALGORITHM_FAILURE"), - 2: .same(proto: "DECRYPT_CERT_NO_SUCH_PADDING_FAILURE"), - 3: .same(proto: "DECRYPT_CERT_INVALID_KEY_FAILURE"), - 4: .same(proto: "DECRYPT_CERT_INVALID_ALGORITHM_PARAMETER_FAILURE"), - 5: .same(proto: "DECRYPT_CERT_ILLEGAL_BLOCK_SIZE_FAILURE"), - 6: .same(proto: "DECRYPT_CERT_BAD_PADDING_FAILURE"), - ] -} - -extension Location_Nearby_Proto_Sharing_ContactAccess: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONTACT_ACCESS_UNKNOWN"), - 1: .same(proto: "CONTACT_ACCESS_NO_CONTACT_UPLOADED"), - 2: .same(proto: "CONTACT_ACCESS_ONLY_UPLOAD_GOOGLE_CONTACT"), - 3: .same(proto: "CONTACT_ACCESS_UPLOAD_CONTACT_FOR_DEVICE_CONTACT_CONSENT"), - 4: .same(proto: "CONTACT_ACCESS_UPLOAD_CONTACT_FOR_QUICK_SHARE_CONSENT"), - ] -} - -extension Location_Nearby_Proto_Sharing_IdentityVerification: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "IDENTITY_VERIFICATION_UNKNOWN"), - 1: .same(proto: "IDENTITY_VERIFICATION_NO_PHONE_NUMBER_VERIFIED"), - 2: .same(proto: "IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_NOT_LINKED_TO_GAIA"), - 3: .same(proto: "IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_LINKED_TO_QS_GAIA"), - ] -} - -extension Location_Nearby_Proto_Sharing_ButtonStatus: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "BUTTON_STATUS_UNKNOWN"), - 1: .same(proto: "BUTTON_STATUS_CLICK_ACCEPT"), - 2: .same(proto: "BUTTON_STATUS_CLICK_REJECT"), - 3: .same(proto: "BUTTON_STATUS_IGNORE"), - ] +nonisolated extension Location_Nearby_Proto_Sharing_ButtonStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0BUTTON_STATUS_UNKNOWN\0\u{1}BUTTON_STATUS_CLICK_ACCEPT\0\u{1}BUTTON_STATUS_CLICK_REJECT\0\u{1}BUTTON_STATUS_IGNORE\0") } diff --git a/airsync-mac/Core/QuickShare/Protobuf/ukey.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/ukey.pb.swift index 0219458f..f8597e01 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/ukey.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/ukey.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: ukey.proto @@ -21,7 +22,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif @preconcurrency import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -30,111 +35,63 @@ import Foundation // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } -enum Securegcm_Ukey2HandshakeCipher: SwiftProtobuf.Enum { - typealias RawValue = Int - case reserved // = 0 +enum Securegcm_Ukey2HandshakeCipher: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case reserved = 0 /// NIST P-256 used for ECDH, SHA512 used for - case p256Sha512 // = 100 + case p256Sha512 = 100 /// commitment - case curve25519Sha512 // = 200 + case curve25519Sha512 = 200 init() { self = .reserved } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .reserved - case 100: self = .p256Sha512 - case 200: self = .curve25519Sha512 - default: return nil - } - } - - var rawValue: Int { - switch self { - case .reserved: return 0 - case .p256Sha512: return 100 - case .curve25519Sha512: return 200 - } - } - -} - -#if swift(>=4.2) - -extension Securegcm_Ukey2HandshakeCipher: CaseIterable { - // Support synthesized by the compiler. } -#endif // swift(>=4.2) - -struct Securegcm_Ukey2Message { +nonisolated struct Securegcm_Ukey2Message: Sendable { // 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. /// Identifies message type var messageType: Securegcm_Ukey2Message.TypeEnum { - get {return _messageType ?? .unknownDoNotUse} + get {_messageType ?? .unknownDoNotUse} set {_messageType = newValue} } /// Returns true if `messageType` has been explicitly set. - var hasMessageType: Bool {return self._messageType != nil} + var hasMessageType: Bool {self._messageType != nil} /// Clears the value of `messageType`. Subsequent reads from it will return its default value. mutating func clearMessageType() {self._messageType = nil} /// Actual message, to be parsed according to var messageData: Data { - get {return _messageData ?? Data()} + get {_messageData ?? Data()} set {_messageData = newValue} } /// Returns true if `messageData` has been explicitly set. - var hasMessageData: Bool {return self._messageData != nil} + var hasMessageData: Bool {self._messageData != nil} /// Clears the value of `messageData`. Subsequent reads from it will return its default value. mutating func clearMessageData() {self._messageData = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownDoNotUse // = 0 - case alert // = 1 - case clientInit // = 2 - case serverInit // = 3 - case clientFinish // = 4 + enum TypeEnum: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownDoNotUse = 0 + case alert = 1 + case clientInit = 2 + case serverInit = 3 + case clientFinish = 4 init() { self = .unknownDoNotUse } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownDoNotUse - case 1: self = .alert - case 2: self = .clientInit - case 3: self = .serverInit - case 4: self = .clientFinish - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownDoNotUse: return 0 - case .alert: return 1 - case .clientInit: return 2 - case .serverInit: return 3 - case .clientFinish: return 4 - } - } - } init() {} @@ -143,107 +100,67 @@ struct Securegcm_Ukey2Message { fileprivate var _messageData: Data? = nil } -#if swift(>=4.2) - -extension Securegcm_Ukey2Message.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Securegcm_Ukey2Alert { +nonisolated struct Securegcm_Ukey2Alert: Sendable { // 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 type: Securegcm_Ukey2Alert.AlertType { - get {return _type ?? .badMessage} + get {_type ?? .badMessage} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} var errorMessage: String { - get {return _errorMessage ?? String()} + get {_errorMessage ?? String()} set {_errorMessage = newValue} } /// Returns true if `errorMessage` has been explicitly set. - var hasErrorMessage: Bool {return self._errorMessage != nil} + var hasErrorMessage: Bool {self._errorMessage != nil} /// Clears the value of `errorMessage`. Subsequent reads from it will return its default value. mutating func clearErrorMessage() {self._errorMessage = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum AlertType: SwiftProtobuf.Enum { - typealias RawValue = Int + enum AlertType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { /// Framing errors - case badMessage // = 1 + case badMessage = 1 /// message_type has an undefined value - case badMessageType // = 2 + case badMessageType = 2 /// message_type received does not correspond to - case incorrectMessage // = 3 + case incorrectMessage = 3 /// expected type at this stage of the protocol - case badMessageData // = 4 + case badMessageData = 4 /// ClientInit and ServerInit errors - case badVersion // = 100 + case badVersion = 100 /// suitable version to speak with client. - case badRandom // = 101 + case badRandom = 101 /// length - case badHandshakeCipher // = 102 + case badHandshakeCipher = 102 /// The next protocol is missing, unknown, or - case badNextProtocol // = 103 + case badNextProtocol = 103 /// unsupported - case badPublicKey // = 104 + case badPublicKey = 104 /// Other errors - case internalError // = 200 + case internalError = 200 init() { self = .badMessage } - init?(rawValue: Int) { - switch rawValue { - case 1: self = .badMessage - case 2: self = .badMessageType - case 3: self = .incorrectMessage - case 4: self = .badMessageData - case 100: self = .badVersion - case 101: self = .badRandom - case 102: self = .badHandshakeCipher - case 103: self = .badNextProtocol - case 104: self = .badPublicKey - case 200: self = .internalError - default: return nil - } - } - - var rawValue: Int { - switch self { - case .badMessage: return 1 - case .badMessageType: return 2 - case .incorrectMessage: return 3 - case .badMessageData: return 4 - case .badVersion: return 100 - case .badRandom: return 101 - case .badHandshakeCipher: return 102 - case .badNextProtocol: return 103 - case .badPublicKey: return 104 - case .internalError: return 200 - } - } - } init() {} @@ -252,36 +169,28 @@ struct Securegcm_Ukey2Alert { fileprivate var _errorMessage: String? = nil } -#if swift(>=4.2) - -extension Securegcm_Ukey2Alert.AlertType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct Securegcm_Ukey2ClientInit { +nonisolated struct Securegcm_Ukey2ClientInit: Sendable { // 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. /// highest supported version for rollback var version: Int32 { - get {return _version ?? 0} + get {_version ?? 0} set {_version = newValue} } /// Returns true if `version` has been explicitly set. - var hasVersion: Bool {return self._version != nil} + var hasVersion: Bool {self._version != nil} /// Clears the value of `version`. Subsequent reads from it will return its default value. mutating func clearVersion() {self._version = nil} /// protection var random: Data { - get {return _random ?? Data()} + get {_random ?? Data()} set {_random = newValue} } /// Returns true if `random` has been explicitly set. - var hasRandom: Bool {return self._random != nil} + var hasRandom: Bool {self._random != nil} /// Clears the value of `random`. Subsequent reads from it will return its default value. mutating func clearRandom() {self._random = nil} @@ -289,11 +198,11 @@ struct Securegcm_Ukey2ClientInit { /// Next protocol that the client wants to speak. var nextProtocol: String { - get {return _nextProtocol ?? String()} + get {_nextProtocol ?? String()} set {_nextProtocol = newValue} } /// Returns true if `nextProtocol` has been explicitly set. - var hasNextProtocol: Bool {return self._nextProtocol != nil} + var hasNextProtocol: Bool {self._nextProtocol != nil} /// Clears the value of `nextProtocol`. Subsequent reads from it will return its default value. mutating func clearNextProtocol() {self._nextProtocol = nil} @@ -301,26 +210,26 @@ struct Securegcm_Ukey2ClientInit { /// One commitment (hash of ClientFinished containing public key) per supported /// cipher - struct CipherCommitment { + nonisolated struct CipherCommitment: Sendable { // 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 handshakeCipher: Securegcm_Ukey2HandshakeCipher { - get {return _handshakeCipher ?? .reserved} + get {_handshakeCipher ?? .reserved} set {_handshakeCipher = newValue} } /// Returns true if `handshakeCipher` has been explicitly set. - var hasHandshakeCipher: Bool {return self._handshakeCipher != nil} + var hasHandshakeCipher: Bool {self._handshakeCipher != nil} /// Clears the value of `handshakeCipher`. Subsequent reads from it will return its default value. mutating func clearHandshakeCipher() {self._handshakeCipher = nil} var commitment: Data { - get {return _commitment ?? Data()} + get {_commitment ?? Data()} set {_commitment = newValue} } /// Returns true if `commitment` has been explicitly set. - var hasCommitment: Bool {return self._commitment != nil} + var hasCommitment: Bool {self._commitment != nil} /// Clears the value of `commitment`. Subsequent reads from it will return its default value. mutating func clearCommitment() {self._commitment = nil} @@ -339,47 +248,47 @@ struct Securegcm_Ukey2ClientInit { fileprivate var _nextProtocol: String? = nil } -struct Securegcm_Ukey2ServerInit { +nonisolated struct Securegcm_Ukey2ServerInit: Sendable { // 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. /// highest supported version for rollback var version: Int32 { - get {return _version ?? 0} + get {_version ?? 0} set {_version = newValue} } /// Returns true if `version` has been explicitly set. - var hasVersion: Bool {return self._version != nil} + var hasVersion: Bool {self._version != nil} /// Clears the value of `version`. Subsequent reads from it will return its default value. mutating func clearVersion() {self._version = nil} /// protection var random: Data { - get {return _random ?? Data()} + get {_random ?? Data()} set {_random = newValue} } /// Returns true if `random` has been explicitly set. - var hasRandom: Bool {return self._random != nil} + var hasRandom: Bool {self._random != nil} /// Clears the value of `random`. Subsequent reads from it will return its default value. mutating func clearRandom() {self._random = nil} /// Selected Cipher and corresponding public key var handshakeCipher: Securegcm_Ukey2HandshakeCipher { - get {return _handshakeCipher ?? .reserved} + get {_handshakeCipher ?? .reserved} set {_handshakeCipher = newValue} } /// Returns true if `handshakeCipher` has been explicitly set. - var hasHandshakeCipher: Bool {return self._handshakeCipher != nil} + var hasHandshakeCipher: Bool {self._handshakeCipher != nil} /// Clears the value of `handshakeCipher`. Subsequent reads from it will return its default value. mutating func clearHandshakeCipher() {self._handshakeCipher = nil} var publicKey: Data { - get {return _publicKey ?? Data()} + get {_publicKey ?? Data()} set {_publicKey = newValue} } /// Returns true if `publicKey` has been explicitly set. - var hasPublicKey: Bool {return self._publicKey != nil} + var hasPublicKey: Bool {self._publicKey != nil} /// Clears the value of `publicKey`. Subsequent reads from it will return its default value. mutating func clearPublicKey() {self._publicKey = nil} @@ -393,18 +302,18 @@ struct Securegcm_Ukey2ServerInit { fileprivate var _publicKey: Data? = nil } -struct Securegcm_Ukey2ClientFinished { +nonisolated struct Securegcm_Ukey2ClientFinished: Sendable { // 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. /// public key matching selected handshake var publicKey: Data { - get {return _publicKey ?? Data()} + get {_publicKey ?? Data()} set {_publicKey = newValue} } /// Returns true if `publicKey` has been explicitly set. - var hasPublicKey: Bool {return self._publicKey != nil} + var hasPublicKey: Bool {self._publicKey != nil} /// Clears the value of `publicKey`. Subsequent reads from it will return its default value. mutating func clearPublicKey() {self._publicKey = nil} @@ -415,36 +324,17 @@ struct Securegcm_Ukey2ClientFinished { fileprivate var _publicKey: Data? = nil } -#if swift(>=5.5) && canImport(_Concurrency) -extension Securegcm_Ukey2HandshakeCipher: @unchecked Sendable {} -extension Securegcm_Ukey2Message: @unchecked Sendable {} -extension Securegcm_Ukey2Message.TypeEnum: @unchecked Sendable {} -extension Securegcm_Ukey2Alert: @unchecked Sendable {} -extension Securegcm_Ukey2Alert.AlertType: @unchecked Sendable {} -extension Securegcm_Ukey2ClientInit: @unchecked Sendable {} -extension Securegcm_Ukey2ClientInit.CipherCommitment: @unchecked Sendable {} -extension Securegcm_Ukey2ServerInit: @unchecked Sendable {} -extension Securegcm_Ukey2ClientFinished: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "securegcm" +nonisolated fileprivate let _protobuf_package = "securegcm" -extension Securegcm_Ukey2HandshakeCipher: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "RESERVED"), - 100: .same(proto: "P256_SHA512"), - 200: .same(proto: "CURVE25519_SHA512"), - ] +nonisolated extension Securegcm_Ukey2HandshakeCipher: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0RESERVED\0\u{2}d\u{1}P256_SHA512\0\u{2}d\u{1}CURVE25519_SHA512\0") } -extension Securegcm_Ukey2Message: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_Ukey2Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Ukey2Message" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "message_type"), - 2: .standard(proto: "message_data"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_type\0\u{3}message_data\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -481,22 +371,13 @@ extension Securegcm_Ukey2Message: @preconcurrency SwiftProtobuf.Message, @precon } } -extension Securegcm_Ukey2Message.TypeEnum: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_DO_NOT_USE"), - 1: .same(proto: "ALERT"), - 2: .same(proto: "CLIENT_INIT"), - 3: .same(proto: "SERVER_INIT"), - 4: .same(proto: "CLIENT_FINISH"), - ] +nonisolated extension Securegcm_Ukey2Message.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_DO_NOT_USE\0\u{1}ALERT\0\u{1}CLIENT_INIT\0\u{1}SERVER_INIT\0\u{1}CLIENT_FINISH\0") } -extension Securegcm_Ukey2Alert: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_Ukey2Alert: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Ukey2Alert" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .standard(proto: "error_message"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}error_message\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -533,29 +414,13 @@ extension Securegcm_Ukey2Alert: @preconcurrency SwiftProtobuf.Message, @preconcu } } -extension Securegcm_Ukey2Alert.AlertType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "BAD_MESSAGE"), - 2: .same(proto: "BAD_MESSAGE_TYPE"), - 3: .same(proto: "INCORRECT_MESSAGE"), - 4: .same(proto: "BAD_MESSAGE_DATA"), - 100: .same(proto: "BAD_VERSION"), - 101: .same(proto: "BAD_RANDOM"), - 102: .same(proto: "BAD_HANDSHAKE_CIPHER"), - 103: .same(proto: "BAD_NEXT_PROTOCOL"), - 104: .same(proto: "BAD_PUBLIC_KEY"), - 200: .same(proto: "INTERNAL_ERROR"), - ] +nonisolated extension Securegcm_Ukey2Alert.AlertType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}BAD_MESSAGE\0\u{1}BAD_MESSAGE_TYPE\0\u{1}INCORRECT_MESSAGE\0\u{1}BAD_MESSAGE_DATA\0\u{2}`\u{1}BAD_VERSION\0\u{1}BAD_RANDOM\0\u{1}BAD_HANDSHAKE_CIPHER\0\u{1}BAD_NEXT_PROTOCOL\0\u{1}BAD_PUBLIC_KEY\0\u{2}`\u{1}INTERNAL_ERROR\0") } -extension Securegcm_Ukey2ClientInit: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_Ukey2ClientInit: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Ukey2ClientInit" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "version"), - 2: .same(proto: "random"), - 3: .standard(proto: "cipher_commitments"), - 4: .standard(proto: "next_protocol"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}random\0\u{3}cipher_commitments\0\u{3}next_protocol\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -602,12 +467,9 @@ extension Securegcm_Ukey2ClientInit: @preconcurrency SwiftProtobuf.Message, @pre } } -extension Securegcm_Ukey2ClientInit.CipherCommitment: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_Ukey2ClientInit.CipherCommitment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Securegcm_Ukey2ClientInit.protoMessageName + ".CipherCommitment" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "handshake_cipher"), - 2: .same(proto: "commitment"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}handshake_cipher\0\u{1}commitment\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -644,14 +506,9 @@ extension Securegcm_Ukey2ClientInit.CipherCommitment: @preconcurrency SwiftProto } } -extension Securegcm_Ukey2ServerInit: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_Ukey2ServerInit: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Ukey2ServerInit" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "version"), - 2: .same(proto: "random"), - 3: .standard(proto: "handshake_cipher"), - 4: .standard(proto: "public_key"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}random\0\u{3}handshake_cipher\0\u{3}public_key\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -698,11 +555,9 @@ extension Securegcm_Ukey2ServerInit: @preconcurrency SwiftProtobuf.Message, @pre } } -extension Securegcm_Ukey2ClientFinished: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Securegcm_Ukey2ClientFinished: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Ukey2ClientFinished" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "public_key"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_key\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { diff --git a/airsync-mac/Core/QuickShare/Protobuf/wire_format.pb.swift b/airsync-mac/Core/QuickShare/Protobuf/wire_format.pb.swift index d0577cbb..dcb5b379 100644 --- a/airsync-mac/Core/QuickShare/Protobuf/wire_format.pb.swift +++ b/airsync-mac/Core/QuickShare/Protobuf/wire_format.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: wire_format.proto @@ -21,7 +22,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif @preconcurrency import SwiftProtobuf // If the compiler emits an error on this type, it is because this file @@ -30,152 +35,126 @@ import Foundation // 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 {} + nonisolated struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// File metadata. Does not include the actual bytes of the file. /// NEXT_ID=10 -struct Sharing_Nearby_FileMetadata { +nonisolated struct Sharing_Nearby_FileMetadata: Sendable { // 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. /// The human readable name of this file (eg. 'Cookbook.pdf'). var name: String { - get {return _name ?? String()} + get {_name ?? String()} set {_name = newValue} } /// Returns true if `name` has been explicitly set. - var hasName: Bool {return self._name != nil} + var hasName: Bool {self._name != nil} /// Clears the value of `name`. Subsequent reads from it will return its default value. mutating func clearName() {self._name = nil} /// The type of file (eg. 'IMAGE' from 'dog.jpg'). Specifying a type helps /// provide a richer experience on the receiving side. var type: Sharing_Nearby_FileMetadata.TypeEnum { - get {return _type ?? .unknown} + get {_type ?? .unknown} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} /// The FILE payload id that will be sent as a follow up containing the actual /// bytes of the file. var payloadID: Int64 { - get {return _payloadID ?? 0} + get {_payloadID ?? 0} set {_payloadID = newValue} } /// Returns true if `payloadID` has been explicitly set. - var hasPayloadID: Bool {return self._payloadID != nil} + var hasPayloadID: Bool {self._payloadID != nil} /// Clears the value of `payloadID`. Subsequent reads from it will return its default value. mutating func clearPayloadID() {self._payloadID = nil} /// The total size of the file. var size: Int64 { - get {return _size ?? 0} + get {_size ?? 0} set {_size = newValue} } /// Returns true if `size` has been explicitly set. - var hasSize: Bool {return self._size != nil} + var hasSize: Bool {self._size != nil} /// Clears the value of `size`. Subsequent reads from it will return its default value. mutating func clearSize() {self._size = nil} /// The mimeType of file (eg. 'image/jpeg' from 'dog.jpg'). Specifying a /// mimeType helps provide a richer experience on receiving side. var mimeType: String { - get {return _mimeType ?? "application/octet-stream"} + get {_mimeType ?? "application/octet-stream"} set {_mimeType = newValue} } /// Returns true if `mimeType` has been explicitly set. - var hasMimeType: Bool {return self._mimeType != nil} + var hasMimeType: Bool {self._mimeType != nil} /// Clears the value of `mimeType`. Subsequent reads from it will return its default value. mutating func clearMimeType() {self._mimeType = nil} /// A uuid for the attachment. Should be unique across all attachments. var id: Int64 { - get {return _id ?? 0} + get {_id ?? 0} set {_id = newValue} } /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} + var hasID: Bool {self._id != nil} /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} /// The parent folder. var parentFolder: String { - get {return _parentFolder ?? String()} + get {_parentFolder ?? String()} set {_parentFolder = newValue} } /// Returns true if `parentFolder` has been explicitly set. - var hasParentFolder: Bool {return self._parentFolder != nil} + var hasParentFolder: Bool {self._parentFolder != nil} /// Clears the value of `parentFolder`. Subsequent reads from it will return its default value. mutating func clearParentFolder() {self._parentFolder = nil} /// A stable identifier for the attachment. Used for receiver to identify same /// attachment from different transfers. var attachmentHash: Int64 { - get {return _attachmentHash ?? 0} + get {_attachmentHash ?? 0} set {_attachmentHash = newValue} } /// Returns true if `attachmentHash` has been explicitly set. - var hasAttachmentHash: Bool {return self._attachmentHash != nil} + var hasAttachmentHash: Bool {self._attachmentHash != nil} /// Clears the value of `attachmentHash`. Subsequent reads from it will return its default value. mutating func clearAttachmentHash() {self._attachmentHash = nil} /// True, if image in file attachment is sensitive var isSensitiveContent: Bool { - get {return _isSensitiveContent ?? false} + get {_isSensitiveContent ?? false} set {_isSensitiveContent = newValue} } /// Returns true if `isSensitiveContent` has been explicitly set. - var hasIsSensitiveContent: Bool {return self._isSensitiveContent != nil} + var hasIsSensitiveContent: Bool {self._isSensitiveContent != nil} /// Clears the value of `isSensitiveContent`. Subsequent reads from it will return its default value. mutating func clearIsSensitiveContent() {self._isSensitiveContent = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case image // = 1 - case video // = 2 - case androidApp // = 3 - case audio // = 4 - case document // = 5 - case contactCard // = 6 + enum TypeEnum: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case image = 1 + case video = 2 + case androidApp = 3 + case audio = 4 + case document = 5 + case contactCard = 6 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .image - case 2: self = .video - case 3: self = .androidApp - case 4: self = .audio - case 5: self = .document - case 6: self = .contactCard - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .image: return 1 - case .video: return 2 - case .androidApp: return 3 - case .audio: return 4 - case .document: return 5 - case .contactCard: return 6 - } - } - } init() {} @@ -191,122 +170,92 @@ struct Sharing_Nearby_FileMetadata { fileprivate var _isSensitiveContent: Bool? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_FileMetadata.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// NEXT_ID=8 -struct Sharing_Nearby_TextMetadata { +nonisolated struct Sharing_Nearby_TextMetadata: Sendable { // 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. /// The title of the text content. var textTitle: String { - get {return _textTitle ?? String()} + get {_textTitle ?? String()} set {_textTitle = newValue} } /// Returns true if `textTitle` has been explicitly set. - var hasTextTitle: Bool {return self._textTitle != nil} + var hasTextTitle: Bool {self._textTitle != nil} /// Clears the value of `textTitle`. Subsequent reads from it will return its default value. mutating func clearTextTitle() {self._textTitle = nil} /// The type of text (phone number, url, address, or plain text). var type: Sharing_Nearby_TextMetadata.TypeEnum { - get {return _type ?? .unknown} + get {_type ?? .unknown} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} /// The BYTE payload id that will be sent as a follow up containing the actual /// bytes of the text. var payloadID: Int64 { - get {return _payloadID ?? 0} + get {_payloadID ?? 0} set {_payloadID = newValue} } /// Returns true if `payloadID` has been explicitly set. - var hasPayloadID: Bool {return self._payloadID != nil} + var hasPayloadID: Bool {self._payloadID != nil} /// Clears the value of `payloadID`. Subsequent reads from it will return its default value. mutating func clearPayloadID() {self._payloadID = nil} /// The size of the text content. var size: Int64 { - get {return _size ?? 0} + get {_size ?? 0} set {_size = newValue} } /// Returns true if `size` has been explicitly set. - var hasSize: Bool {return self._size != nil} + var hasSize: Bool {self._size != nil} /// Clears the value of `size`. Subsequent reads from it will return its default value. mutating func clearSize() {self._size = nil} /// A uuid for the attachment. Should be unique across all attachments. var id: Int64 { - get {return _id ?? 0} + get {_id ?? 0} set {_id = newValue} } /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} + var hasID: Bool {self._id != nil} /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} /// True if text is sensitive, e.g. password var isSensitiveText: Bool { - get {return _isSensitiveText ?? false} + get {_isSensitiveText ?? false} set {_isSensitiveText = newValue} } /// Returns true if `isSensitiveText` has been explicitly set. - var hasIsSensitiveText: Bool {return self._isSensitiveText != nil} + var hasIsSensitiveText: Bool {self._isSensitiveText != nil} /// Clears the value of `isSensitiveText`. Subsequent reads from it will return its default value. mutating func clearIsSensitiveText() {self._isSensitiveText = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case text // = 1 + enum TypeEnum: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case text = 1 /// Open with browsers. - case url // = 2 + case url = 2 /// Open with map apps. - case address // = 3 + case address = 3 /// Dial. - case phoneNumber // = 4 + case phoneNumber = 4 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .text - case 2: self = .url - case 3: self = .address - case 4: self = .phoneNumber - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .text: return 1 - case .url: return 2 - case .address: return 3 - case .phoneNumber: return 4 - } - } - } init() {} @@ -319,96 +268,66 @@ struct Sharing_Nearby_TextMetadata { fileprivate var _isSensitiveText: Bool? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_TextMetadata.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// NEXT_ID=6 -struct Sharing_Nearby_WifiCredentialsMetadata { +nonisolated struct Sharing_Nearby_WifiCredentialsMetadata: Sendable { // 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. /// The Wifi network name. This will be sent in introduction. var ssid: String { - get {return _ssid ?? String()} + get {_ssid ?? String()} set {_ssid = newValue} } /// Returns true if `ssid` has been explicitly set. - var hasSsid: Bool {return self._ssid != nil} + var hasSsid: Bool {self._ssid != nil} /// Clears the value of `ssid`. Subsequent reads from it will return its default value. mutating func clearSsid() {self._ssid = nil} /// The security type of network (OPEN, WPA_PSK, WEP). var securityType: Sharing_Nearby_WifiCredentialsMetadata.SecurityType { - get {return _securityType ?? .unknownSecurityType} + get {_securityType ?? .unknownSecurityType} set {_securityType = newValue} } /// Returns true if `securityType` has been explicitly set. - var hasSecurityType: Bool {return self._securityType != nil} + var hasSecurityType: Bool {self._securityType != nil} /// Clears the value of `securityType`. Subsequent reads from it will return its default value. mutating func clearSecurityType() {self._securityType = nil} /// The BYTE payload id that will be sent as a follow up containing the /// password. var payloadID: Int64 { - get {return _payloadID ?? 0} + get {_payloadID ?? 0} set {_payloadID = newValue} } /// Returns true if `payloadID` has been explicitly set. - var hasPayloadID: Bool {return self._payloadID != nil} + var hasPayloadID: Bool {self._payloadID != nil} /// Clears the value of `payloadID`. Subsequent reads from it will return its default value. mutating func clearPayloadID() {self._payloadID = nil} /// A uuid for the attachment. Should be unique across all attachments. var id: Int64 { - get {return _id ?? 0} + get {_id ?? 0} set {_id = newValue} } /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} + var hasID: Bool {self._id != nil} /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum SecurityType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownSecurityType // = 0 - case `open` // = 1 - case wpaPsk // = 2 - case wep // = 3 - case sae // = 4 + enum SecurityType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownSecurityType = 0 + case `open` = 1 + case wpaPsk = 2 + case wep = 3 + case sae = 4 init() { self = .unknownSecurityType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownSecurityType - case 1: self = .open - case 2: self = .wpaPsk - case 3: self = .wep - case 4: self = .sae - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownSecurityType: return 0 - case .open: return 1 - case .wpaPsk: return 2 - case .wep: return 3 - case .sae: return 4 - } - } - } init() {} @@ -419,37 +338,29 @@ struct Sharing_Nearby_WifiCredentialsMetadata { fileprivate var _id: Int64? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// NEXT_ID=8 -struct Sharing_Nearby_AppMetadata { +nonisolated struct Sharing_Nearby_AppMetadata: Sendable { // 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. /// The app name. This will be sent in introduction. var appName: String { - get {return _appName ?? String()} + get {_appName ?? String()} set {_appName = newValue} } /// Returns true if `appName` has been explicitly set. - var hasAppName: Bool {return self._appName != nil} + var hasAppName: Bool {self._appName != nil} /// Clears the value of `appName`. Subsequent reads from it will return its default value. mutating func clearAppName() {self._appName = nil} /// The size of the all split of apks. var size: Int64 { - get {return _size ?? 0} + get {_size ?? 0} set {_size = newValue} } /// Returns true if `size` has been explicitly set. - var hasSize: Bool {return self._size != nil} + var hasSize: Bool {self._size != nil} /// Clears the value of `size`. Subsequent reads from it will return its default value. mutating func clearSize() {self._size = nil} @@ -459,11 +370,11 @@ struct Sharing_Nearby_AppMetadata { /// A uuid for the attachment. Should be unique across all attachments. var id: Int64 { - get {return _id ?? 0} + get {_id ?? 0} set {_id = newValue} } /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} + var hasID: Bool {self._id != nil} /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} @@ -475,11 +386,11 @@ struct Sharing_Nearby_AppMetadata { /// The package name. This will be sent in introduction. var packageName: String { - get {return _packageName ?? String()} + get {_packageName ?? String()} set {_packageName = newValue} } /// Returns true if `packageName` has been explicitly set. - var hasPackageName: Bool {return self._packageName != nil} + var hasPackageName: Bool {self._packageName != nil} /// Clears the value of `packageName`. Subsequent reads from it will return its default value. mutating func clearPackageName() {self._packageName = nil} @@ -494,39 +405,39 @@ struct Sharing_Nearby_AppMetadata { } /// NEXT_ID=5 -struct Sharing_Nearby_StreamMetadata { +nonisolated struct Sharing_Nearby_StreamMetadata: Sendable { // 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. /// A human readable description for the stream. var description_p: String { - get {return _description_p ?? String()} + get {_description_p ?? String()} set {_description_p = newValue} } /// Returns true if `description_p` has been explicitly set. - var hasDescription_p: Bool {return self._description_p != nil} + var hasDescription_p: Bool {self._description_p != nil} /// Clears the value of `description_p`. Subsequent reads from it will return its default value. mutating func clearDescription_p() {self._description_p = nil} /// The package name of the sending application. var packageName: String { - get {return _packageName ?? String()} + get {_packageName ?? String()} set {_packageName = newValue} } /// Returns true if `packageName` has been explicitly set. - var hasPackageName: Bool {return self._packageName != nil} + var hasPackageName: Bool {self._packageName != nil} /// Clears the value of `packageName`. Subsequent reads from it will return its default value. mutating func clearPackageName() {self._packageName = nil} /// The payload id that will be send as a followup containing the /// ParcelFileDescriptor. var payloadID: Int64 { - get {return _payloadID ?? 0} + get {_payloadID ?? 0} set {_payloadID = newValue} } /// Returns true if `payloadID` has been explicitly set. - var hasPayloadID: Bool {return self._payloadID != nil} + var hasPayloadID: Bool {self._payloadID != nil} /// Clears the value of `payloadID`. Subsequent reads from it will return its default value. mutating func clearPayloadID() {self._payloadID = nil} @@ -534,11 +445,11 @@ struct Sharing_Nearby_StreamMetadata { /// attribution if no other information is available (i.e. the package is not /// installed locally yet). var attributedAppName: String { - get {return _attributedAppName ?? String()} + get {_attributedAppName ?? String()} set {_attributedAppName = newValue} } /// Returns true if `attributedAppName` has been explicitly set. - var hasAttributedAppName: Bool {return self._attributedAppName != nil} + var hasAttributedAppName: Bool {self._attributedAppName != nil} /// Clears the value of `attributedAppName`. Subsequent reads from it will return its default value. mutating func clearAttributedAppName() {self._attributedAppName = nil} @@ -554,57 +465,41 @@ struct Sharing_Nearby_StreamMetadata { /// A frame used when sending messages over the wire. /// NEXT_ID=3 -struct Sharing_Nearby_Frame { +nonisolated struct Sharing_Nearby_Frame: Sendable { // 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 version: Sharing_Nearby_Frame.Version { - get {return _version ?? .unknownVersion} + get {_version ?? .unknownVersion} set {_version = newValue} } /// Returns true if `version` has been explicitly set. - var hasVersion: Bool {return self._version != nil} + var hasVersion: Bool {self._version != nil} /// Clears the value of `version`. Subsequent reads from it will return its default value. mutating func clearVersion() {self._version = nil} /// Right now there's only 1 version, but if there are more, exactly one of /// the following fields will be set. var v1: Sharing_Nearby_V1Frame { - get {return _v1 ?? Sharing_Nearby_V1Frame()} + get {_v1 ?? Sharing_Nearby_V1Frame()} set {_v1 = newValue} } /// Returns true if `v1` has been explicitly set. - var hasV1: Bool {return self._v1 != nil} + var hasV1: Bool {self._v1 != nil} /// Clears the value of `v1`. Subsequent reads from it will return its default value. mutating func clearV1() {self._v1 = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum Version: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownVersion // = 0 - case v1 // = 1 + enum Version: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownVersion = 0 + case v1 = 1 init() { self = .unknownVersion } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownVersion - case 1: self = .v1 - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownVersion: return 0 - case .v1: return 1 - } - } - } init() {} @@ -613,132 +508,98 @@ struct Sharing_Nearby_Frame { fileprivate var _v1: Sharing_Nearby_V1Frame? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_Frame.Version: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// NEXT_ID=8 -struct Sharing_Nearby_V1Frame { +nonisolated struct Sharing_Nearby_V1Frame: @unchecked Sendable { // 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 type: Sharing_Nearby_V1Frame.FrameType { - get {return _storage._type ?? .unknownFrameType} + get {_storage._type ?? .unknownFrameType} set {_uniqueStorage()._type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return _storage._type != nil} + var hasType: Bool {_storage._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {_uniqueStorage()._type = nil} /// At most one of the following fields will be set. var introduction: Sharing_Nearby_IntroductionFrame { - get {return _storage._introduction ?? Sharing_Nearby_IntroductionFrame()} + get {_storage._introduction ?? Sharing_Nearby_IntroductionFrame()} set {_uniqueStorage()._introduction = newValue} } /// Returns true if `introduction` has been explicitly set. - var hasIntroduction: Bool {return _storage._introduction != nil} + var hasIntroduction: Bool {_storage._introduction != nil} /// Clears the value of `introduction`. Subsequent reads from it will return its default value. mutating func clearIntroduction() {_uniqueStorage()._introduction = nil} var connectionResponse: Sharing_Nearby_ConnectionResponseFrame { - get {return _storage._connectionResponse ?? Sharing_Nearby_ConnectionResponseFrame()} + get {_storage._connectionResponse ?? Sharing_Nearby_ConnectionResponseFrame()} set {_uniqueStorage()._connectionResponse = newValue} } /// Returns true if `connectionResponse` has been explicitly set. - var hasConnectionResponse: Bool {return _storage._connectionResponse != nil} + var hasConnectionResponse: Bool {_storage._connectionResponse != nil} /// Clears the value of `connectionResponse`. Subsequent reads from it will return its default value. mutating func clearConnectionResponse() {_uniqueStorage()._connectionResponse = nil} var pairedKeyEncryption: Sharing_Nearby_PairedKeyEncryptionFrame { - get {return _storage._pairedKeyEncryption ?? Sharing_Nearby_PairedKeyEncryptionFrame()} + get {_storage._pairedKeyEncryption ?? Sharing_Nearby_PairedKeyEncryptionFrame()} set {_uniqueStorage()._pairedKeyEncryption = newValue} } /// Returns true if `pairedKeyEncryption` has been explicitly set. - var hasPairedKeyEncryption: Bool {return _storage._pairedKeyEncryption != nil} + var hasPairedKeyEncryption: Bool {_storage._pairedKeyEncryption != nil} /// Clears the value of `pairedKeyEncryption`. Subsequent reads from it will return its default value. mutating func clearPairedKeyEncryption() {_uniqueStorage()._pairedKeyEncryption = nil} var pairedKeyResult: Sharing_Nearby_PairedKeyResultFrame { - get {return _storage._pairedKeyResult ?? Sharing_Nearby_PairedKeyResultFrame()} + get {_storage._pairedKeyResult ?? Sharing_Nearby_PairedKeyResultFrame()} set {_uniqueStorage()._pairedKeyResult = newValue} } /// Returns true if `pairedKeyResult` has been explicitly set. - var hasPairedKeyResult: Bool {return _storage._pairedKeyResult != nil} + var hasPairedKeyResult: Bool {_storage._pairedKeyResult != nil} /// Clears the value of `pairedKeyResult`. Subsequent reads from it will return its default value. mutating func clearPairedKeyResult() {_uniqueStorage()._pairedKeyResult = nil} + /// NOTE: This field was marked as deprecated in the .proto file. var certificateInfo: Sharing_Nearby_CertificateInfoFrame { - get {return _storage._certificateInfo ?? Sharing_Nearby_CertificateInfoFrame()} + get {_storage._certificateInfo ?? Sharing_Nearby_CertificateInfoFrame()} set {_uniqueStorage()._certificateInfo = newValue} } /// Returns true if `certificateInfo` has been explicitly set. - var hasCertificateInfo: Bool {return _storage._certificateInfo != nil} + var hasCertificateInfo: Bool {_storage._certificateInfo != nil} /// Clears the value of `certificateInfo`. Subsequent reads from it will return its default value. mutating func clearCertificateInfo() {_uniqueStorage()._certificateInfo = nil} + /// NOTE: This field was marked as deprecated in the .proto file. var progressUpdate: Sharing_Nearby_ProgressUpdateFrame { - get {return _storage._progressUpdate ?? Sharing_Nearby_ProgressUpdateFrame()} + get {_storage._progressUpdate ?? Sharing_Nearby_ProgressUpdateFrame()} set {_uniqueStorage()._progressUpdate = newValue} } /// Returns true if `progressUpdate` has been explicitly set. - var hasProgressUpdate: Bool {return _storage._progressUpdate != nil} + var hasProgressUpdate: Bool {_storage._progressUpdate != nil} /// Clears the value of `progressUpdate`. Subsequent reads from it will return its default value. mutating func clearProgressUpdate() {_uniqueStorage()._progressUpdate = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum FrameType: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknownFrameType // = 0 - case introduction // = 1 - case response // = 2 - case pairedKeyEncryption // = 3 - case pairedKeyResult // = 4 + enum FrameType: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknownFrameType = 0 + case introduction = 1 + case response = 2 + case pairedKeyEncryption = 3 + case pairedKeyResult = 4 /// No longer used. - case certificateInfo // = 5 - case cancel // = 6 + case certificateInfo = 5 + case cancel = 6 /// No longer used. - case progressUpdate // = 7 + case progressUpdate = 7 init() { self = .unknownFrameType } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownFrameType - case 1: self = .introduction - case 2: self = .response - case 3: self = .pairedKeyEncryption - case 4: self = .pairedKeyResult - case 5: self = .certificateInfo - case 6: self = .cancel - case 7: self = .progressUpdate - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknownFrameType: return 0 - case .introduction: return 1 - case .response: return 2 - case .pairedKeyEncryption: return 3 - case .pairedKeyResult: return 4 - case .certificateInfo: return 5 - case .cancel: return 6 - case .progressUpdate: return 7 - } - } - } init() {} @@ -746,18 +607,10 @@ struct Sharing_Nearby_V1Frame { fileprivate var _storage = _StorageClass.defaultInstance } -#if swift(>=4.2) - -extension Sharing_Nearby_V1Frame.FrameType: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// An introduction packet sent by the sending side. Contains a list of files /// they'd like to share. /// NEXT_ID=10 -struct Sharing_Nearby_IntroductionFrame { +nonisolated struct Sharing_Nearby_IntroductionFrame: Sendable { // 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. @@ -768,11 +621,11 @@ struct Sharing_Nearby_IntroductionFrame { /// The required app package to open the content. May be null. var requiredPackage: String { - get {return _requiredPackage ?? String()} + get {_requiredPackage ?? String()} set {_requiredPackage = newValue} } /// Returns true if `requiredPackage` has been explicitly set. - var hasRequiredPackage: Bool {return self._requiredPackage != nil} + var hasRequiredPackage: Bool {self._requiredPackage != nil} /// Clears the value of `requiredPackage`. Subsequent reads from it will return its default value. mutating func clearRequiredPackage() {self._requiredPackage = nil} @@ -781,22 +634,22 @@ struct Sharing_Nearby_IntroductionFrame { var appMetadata: [Sharing_Nearby_AppMetadata] = [] var startTransfer: Bool { - get {return _startTransfer ?? false} + get {_startTransfer ?? false} set {_startTransfer = newValue} } /// Returns true if `startTransfer` has been explicitly set. - var hasStartTransfer: Bool {return self._startTransfer != nil} + var hasStartTransfer: Bool {self._startTransfer != nil} /// Clears the value of `startTransfer`. Subsequent reads from it will return its default value. mutating func clearStartTransfer() {self._startTransfer = nil} var streamMetadata: [Sharing_Nearby_StreamMetadata] = [] var useCase: Sharing_Nearby_IntroductionFrame.SharingUseCase { - get {return _useCase ?? .unknown} + get {_useCase ?? .unknown} set {_useCase = newValue} } /// Returns true if `useCase` has been explicitly set. - var hasUseCase: Bool {return self._useCase != nil} + var hasUseCase: Bool {self._useCase != nil} /// Clears the value of `useCase`. Subsequent reads from it will return its default value. mutating func clearUseCase() {self._useCase = nil} @@ -804,33 +657,15 @@ struct Sharing_Nearby_IntroductionFrame { var unknownFields = SwiftProtobuf.UnknownStorage() - enum SharingUseCase: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case nearbyShare // = 1 - case remoteCopy // = 2 + enum SharingUseCase: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case nearbyShare = 1 + case remoteCopy = 2 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .nearbyShare - case 2: self = .remoteCopy - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .nearbyShare: return 1 - case .remoteCopy: return 2 - } - } - } init() {} @@ -840,38 +675,30 @@ struct Sharing_Nearby_IntroductionFrame { fileprivate var _useCase: Sharing_Nearby_IntroductionFrame.SharingUseCase? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_IntroductionFrame.SharingUseCase: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// A progress update packet sent by the sending side. Contains transfer progress /// value. NEXT_ID=3 -struct Sharing_Nearby_ProgressUpdateFrame { +nonisolated struct Sharing_Nearby_ProgressUpdateFrame: Sendable { // 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 progress: Float { - get {return _progress ?? 0} + get {_progress ?? 0} set {_progress = newValue} } /// Returns true if `progress` has been explicitly set. - var hasProgress: Bool {return self._progress != nil} + var hasProgress: Bool {self._progress != nil} /// Clears the value of `progress`. Subsequent reads from it will return its default value. mutating func clearProgress() {self._progress = nil} /// True, if the receiver should start bandwidth upgrade and receiving the /// payloads. var startTransfer: Bool { - get {return _startTransfer ?? false} + get {_startTransfer ?? false} set {_startTransfer = newValue} } /// Returns true if `startTransfer` has been explicitly set. - var hasStartTransfer: Bool {return self._startTransfer != nil} + var hasStartTransfer: Bool {self._startTransfer != nil} /// Clears the value of `startTransfer`. Subsequent reads from it will return its default value. mutating func clearStartTransfer() {self._startTransfer = nil} @@ -886,18 +713,18 @@ struct Sharing_Nearby_ProgressUpdateFrame { /// A response packet sent by the receiving side. Accepts or rejects the list of /// files. /// NEXT_ID=4 -struct Sharing_Nearby_ConnectionResponseFrame { +nonisolated struct Sharing_Nearby_ConnectionResponseFrame: Sendable { // 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. /// The receiving side's response. var status: Sharing_Nearby_ConnectionResponseFrame.Status { - get {return _status ?? .unknown} + get {_status ?? .unknown} set {_status = newValue} } /// Returns true if `status` has been explicitly set. - var hasStatus: Bool {return self._status != nil} + var hasStatus: Bool {self._status != nil} /// Clears the value of `status`. Subsequent reads from it will return its default value. mutating func clearStatus() {self._status = nil} @@ -910,42 +737,18 @@ struct Sharing_Nearby_ConnectionResponseFrame { var unknownFields = SwiftProtobuf.UnknownStorage() - enum Status: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case accept // = 1 - case reject // = 2 - case notEnoughSpace // = 3 - case unsupportedAttachmentType // = 4 - case timedOut // = 5 + enum Status: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case accept = 1 + case reject = 2 + case notEnoughSpace = 3 + case unsupportedAttachmentType = 4 + case timedOut = 5 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .accept - case 2: self = .reject - case 3: self = .notEnoughSpace - case 4: self = .unsupportedAttachmentType - case 5: self = .timedOut - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .accept: return 1 - case .reject: return 2 - case .notEnoughSpace: return 3 - case .unsupportedAttachmentType: return 4 - case .timedOut: return 5 - } - } - } init() {} @@ -953,90 +756,58 @@ struct Sharing_Nearby_ConnectionResponseFrame { fileprivate var _status: Sharing_Nearby_ConnectionResponseFrame.Status? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_ConnectionResponseFrame.Status: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// Attachment details that sent in ConnectionResponseFrame. /// NEXT_ID=3 -struct Sharing_Nearby_AttachmentDetails { +nonisolated struct Sharing_Nearby_AttachmentDetails: Sendable { // 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. /// The attachment family type. var type: Sharing_Nearby_AttachmentDetails.TypeEnum { - get {return _type ?? .unknown} + get {_type ?? .unknown} set {_type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {self._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. mutating func clearType() {self._type = nil} /// This field is only for FILE type. var fileAttachmentDetails: Sharing_Nearby_FileAttachmentDetails { - get {return _fileAttachmentDetails ?? Sharing_Nearby_FileAttachmentDetails()} + get {_fileAttachmentDetails ?? Sharing_Nearby_FileAttachmentDetails()} set {_fileAttachmentDetails = newValue} } /// Returns true if `fileAttachmentDetails` has been explicitly set. - var hasFileAttachmentDetails: Bool {return self._fileAttachmentDetails != nil} + var hasFileAttachmentDetails: Bool {self._fileAttachmentDetails != nil} /// Clears the value of `fileAttachmentDetails`. Subsequent reads from it will return its default value. mutating func clearFileAttachmentDetails() {self._fileAttachmentDetails = nil} var unknownFields = SwiftProtobuf.UnknownStorage() /// LINT.IfChange - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 + enum TypeEnum: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 /// Represents FileAttachment. - case file // = 1 + case file = 1 /// Represents TextAttachment. - case text // = 2 + case text = 2 /// Represents WifiCredentialsAttachment. - case wifiCredentials // = 3 + case wifiCredentials = 3 /// Represents AppAttachment. - case app // = 4 + case app = 4 /// Represents StreamAttachment. - case stream // = 5 + case stream = 5 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .file - case 2: self = .text - case 3: self = .wifiCredentials - case 4: self = .app - case 5: self = .stream - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .file: return 1 - case .text: return 2 - case .wifiCredentials: return 3 - case .app: return 4 - case .stream: return 5 - } - } - } init() {} @@ -1045,28 +816,20 @@ struct Sharing_Nearby_AttachmentDetails { fileprivate var _fileAttachmentDetails: Sharing_Nearby_FileAttachmentDetails? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_AttachmentDetails.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// File attachment details included in ConnectionResponseFrame. /// NEXT_ID=3 -struct Sharing_Nearby_FileAttachmentDetails { +nonisolated struct Sharing_Nearby_FileAttachmentDetails: Sendable { // 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. /// Existing local file size on receiver side. var receiverExistingFileSize: Int64 { - get {return _receiverExistingFileSize ?? 0} + get {_receiverExistingFileSize ?? 0} set {_receiverExistingFileSize = newValue} } /// Returns true if `receiverExistingFileSize` has been explicitly set. - var hasReceiverExistingFileSize: Bool {return self._receiverExistingFileSize != nil} + var hasReceiverExistingFileSize: Bool {self._receiverExistingFileSize != nil} /// Clears the value of `receiverExistingFileSize`. Subsequent reads from it will return its default value. mutating func clearReceiverExistingFileSize() {self._receiverExistingFileSize = nil} @@ -1082,7 +845,7 @@ struct Sharing_Nearby_FileAttachmentDetails { } /// NEXT_ID=2 -struct Sharing_Nearby_PayloadsDetails { +nonisolated struct Sharing_Nearby_PayloadsDetails: Sendable { // 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. @@ -1097,35 +860,35 @@ struct Sharing_Nearby_PayloadsDetails { /// Metadata of a payload file created by Nearby Connections. /// NEXT_ID=4 -struct Sharing_Nearby_PayloadDetails { +nonisolated struct Sharing_Nearby_PayloadDetails: Sendable { // 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 id: Int64 { - get {return _id ?? 0} + get {_id ?? 0} set {_id = newValue} } /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} + var hasID: Bool {self._id != nil} /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} var creationTimestampMillis: Int64 { - get {return _creationTimestampMillis ?? 0} + get {_creationTimestampMillis ?? 0} set {_creationTimestampMillis = newValue} } /// Returns true if `creationTimestampMillis` has been explicitly set. - var hasCreationTimestampMillis: Bool {return self._creationTimestampMillis != nil} + var hasCreationTimestampMillis: Bool {self._creationTimestampMillis != nil} /// Clears the value of `creationTimestampMillis`. Subsequent reads from it will return its default value. mutating func clearCreationTimestampMillis() {self._creationTimestampMillis = nil} var size: Int64 { - get {return _size ?? 0} + get {_size ?? 0} set {_size = newValue} } /// Returns true if `size` has been explicitly set. - var hasSize: Bool {return self._size != nil} + var hasSize: Bool {self._size != nil} /// Clears the value of `size`. Subsequent reads from it will return its default value. mutating func clearSize() {self._size = nil} @@ -1140,38 +903,38 @@ struct Sharing_Nearby_PayloadDetails { /// A paired key encryption packet sent between devices, contains signed data. /// NEXT_ID=5 -struct Sharing_Nearby_PairedKeyEncryptionFrame { +nonisolated struct Sharing_Nearby_PairedKeyEncryptionFrame: Sendable { // 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. /// The encrypted data in byte array format. var signedData: Data { - get {return _signedData ?? Data()} + get {_signedData ?? Data()} set {_signedData = newValue} } /// Returns true if `signedData` has been explicitly set. - var hasSignedData: Bool {return self._signedData != nil} + var hasSignedData: Bool {self._signedData != nil} /// Clears the value of `signedData`. Subsequent reads from it will return its default value. mutating func clearSignedData() {self._signedData = nil} /// The hash of a certificate id. var secretIDHash: Data { - get {return _secretIDHash ?? Data()} + get {_secretIDHash ?? Data()} set {_secretIDHash = newValue} } /// Returns true if `secretIDHash` has been explicitly set. - var hasSecretIDHash: Bool {return self._secretIDHash != nil} + var hasSecretIDHash: Bool {self._secretIDHash != nil} /// Clears the value of `secretIDHash`. Subsequent reads from it will return its default value. mutating func clearSecretIDHash() {self._secretIDHash = nil} /// An optional encrypted data in byte array format. var optionalSignedData: Data { - get {return _optionalSignedData ?? Data()} + get {_optionalSignedData ?? Data()} set {_optionalSignedData = newValue} } /// Returns true if `optionalSignedData` has been explicitly set. - var hasOptionalSignedData: Bool {return self._optionalSignedData != nil} + var hasOptionalSignedData: Bool {self._optionalSignedData != nil} /// Clears the value of `optionalSignedData`. Subsequent reads from it will return its default value. mutating func clearOptionalSignedData() {self._optionalSignedData = nil} @@ -1181,11 +944,11 @@ struct Sharing_Nearby_PairedKeyEncryptionFrame { /// For outgoing connection contains an HKDF of the connection token and of the /// UKEY2 token var qrCodeHandshakeData: Data { - get {return _qrCodeHandshakeData ?? Data()} + get {_qrCodeHandshakeData ?? Data()} set {_qrCodeHandshakeData = newValue} } /// Returns true if `qrCodeHandshakeData` has been explicitly set. - var hasQrCodeHandshakeData: Bool {return self._qrCodeHandshakeData != nil} + var hasQrCodeHandshakeData: Bool {self._qrCodeHandshakeData != nil} /// Clears the value of `qrCodeHandshakeData`. Subsequent reads from it will return its default value. mutating func clearQrCodeHandshakeData() {self._qrCodeHandshakeData = nil} @@ -1201,63 +964,43 @@ struct Sharing_Nearby_PairedKeyEncryptionFrame { /// A paired key verification result packet sent between devices. /// NEXT_ID=3 -struct Sharing_Nearby_PairedKeyResultFrame { +nonisolated struct Sharing_Nearby_PairedKeyResultFrame: Sendable { // 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. /// The verification result. var status: Sharing_Nearby_PairedKeyResultFrame.Status { - get {return _status ?? .unknown} + get {_status ?? .unknown} set {_status = newValue} } /// Returns true if `status` has been explicitly set. - var hasStatus: Bool {return self._status != nil} + var hasStatus: Bool {self._status != nil} /// Clears the value of `status`. Subsequent reads from it will return its default value. mutating func clearStatus() {self._status = nil} /// OS type. var osType: Location_Nearby_Proto_Sharing_OSType { - get {return _osType ?? .unknownOsType} + get {_osType ?? .unknownOsType} set {_osType = newValue} } /// Returns true if `osType` has been explicitly set. - var hasOsType: Bool {return self._osType != nil} + var hasOsType: Bool {self._osType != nil} /// Clears the value of `osType`. Subsequent reads from it will return its default value. mutating func clearOsType() {self._osType = nil} var unknownFields = SwiftProtobuf.UnknownStorage() - enum Status: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case success // = 1 - case fail // = 2 - case unable // = 3 + enum Status: Int, SwiftProtobuf.Enum, Swift.CaseIterable { + case unknown = 0 + case success = 1 + case fail = 2 + case unable = 3 init() { self = .unknown } - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .success - case 2: self = .fail - case 3: self = .unable - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .success: return 1 - case .fail: return 2 - case .unable: return 3 - } - } - } init() {} @@ -1266,17 +1009,9 @@ struct Sharing_Nearby_PairedKeyResultFrame { fileprivate var _osType: Location_Nearby_Proto_Sharing_OSType? = nil } -#if swift(>=4.2) - -extension Sharing_Nearby_PairedKeyResultFrame.Status: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - /// A package containing certificate info to be shared to remote device offline. /// NEXT_ID=2 -struct Sharing_Nearby_CertificateInfoFrame { +nonisolated struct Sharing_Nearby_CertificateInfoFrame: Sendable { // 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. @@ -1291,29 +1026,29 @@ struct Sharing_Nearby_CertificateInfoFrame { /// A public certificate from the local device. /// NEXT_ID=8 -struct Sharing_Nearby_PublicCertificate { +nonisolated struct Sharing_Nearby_PublicCertificate: Sendable { // 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. /// The unique id of the public certificate. var secretID: Data { - get {return _secretID ?? Data()} + get {_secretID ?? Data()} set {_secretID = newValue} } /// Returns true if `secretID` has been explicitly set. - var hasSecretID: Bool {return self._secretID != nil} + var hasSecretID: Bool {self._secretID != nil} /// Clears the value of `secretID`. Subsequent reads from it will return its default value. mutating func clearSecretID() {self._secretID = nil} /// A bytes representation of a Secret Key owned by contact, to decrypt the /// metadata_key stored within the advertisement. var authenticityKey: Data { - get {return _authenticityKey ?? Data()} + get {_authenticityKey ?? Data()} set {_authenticityKey = newValue} } /// Returns true if `authenticityKey` has been explicitly set. - var hasAuthenticityKey: Bool {return self._authenticityKey != nil} + var hasAuthenticityKey: Bool {self._authenticityKey != nil} /// Clears the value of `authenticityKey`. Subsequent reads from it will return its default value. mutating func clearAuthenticityKey() {self._authenticityKey = nil} @@ -1321,31 +1056,31 @@ struct Sharing_Nearby_PublicCertificate { /// to decrypt encrypted UKEY2 (from Nearby Connections API) as a hand shake in /// contact verification phase. var publicKey: Data { - get {return _publicKey ?? Data()} + get {_publicKey ?? Data()} set {_publicKey = newValue} } /// Returns true if `publicKey` has been explicitly set. - var hasPublicKey: Bool {return self._publicKey != nil} + var hasPublicKey: Bool {self._publicKey != nil} /// Clears the value of `publicKey`. Subsequent reads from it will return its default value. mutating func clearPublicKey() {self._publicKey = nil} /// The time in millis from epoch when this certificate becomes effective. var startTime: Int64 { - get {return _startTime ?? 0} + get {_startTime ?? 0} set {_startTime = newValue} } /// Returns true if `startTime` has been explicitly set. - var hasStartTime: Bool {return self._startTime != nil} + var hasStartTime: Bool {self._startTime != nil} /// Clears the value of `startTime`. Subsequent reads from it will return its default value. mutating func clearStartTime() {self._startTime = nil} /// The time in millis from epoch when this certificate expires. var endTime: Int64 { - get {return _endTime ?? 0} + get {_endTime ?? 0} set {_endTime = newValue} } /// Returns true if `endTime` has been explicitly set. - var hasEndTime: Bool {return self._endTime != nil} + var hasEndTime: Bool {self._endTime != nil} /// Clears the value of `endTime`. Subsequent reads from it will return its default value. mutating func clearEndTime() {self._endTime = nil} @@ -1353,21 +1088,21 @@ struct Sharing_Nearby_PublicCertificate { /// device/user who created this certificate. Needs to be decrypted into bytes, /// and converted back to EncryptedMetadata object to access fields. var encryptedMetadataBytes: Data { - get {return _encryptedMetadataBytes ?? Data()} + get {_encryptedMetadataBytes ?? Data()} set {_encryptedMetadataBytes = newValue} } /// Returns true if `encryptedMetadataBytes` has been explicitly set. - var hasEncryptedMetadataBytes: Bool {return self._encryptedMetadataBytes != nil} + var hasEncryptedMetadataBytes: Bool {self._encryptedMetadataBytes != nil} /// Clears the value of `encryptedMetadataBytes`. Subsequent reads from it will return its default value. mutating func clearEncryptedMetadataBytes() {self._encryptedMetadataBytes = nil} /// The tag for verifying metadata_encryption_key. var metadataEncryptionKeyTag: Data { - get {return _metadataEncryptionKeyTag ?? Data()} + get {_metadataEncryptionKeyTag ?? Data()} set {_metadataEncryptionKeyTag = newValue} } /// Returns true if `metadataEncryptionKeyTag` has been explicitly set. - var hasMetadataEncryptionKeyTag: Bool {return self._metadataEncryptionKeyTag != nil} + var hasMetadataEncryptionKeyTag: Bool {self._metadataEncryptionKeyTag != nil} /// Clears the value of `metadataEncryptionKeyTag`. Subsequent reads from it will return its default value. mutating func clearMetadataEncryptionKeyTag() {self._metadataEncryptionKeyTag = nil} @@ -1385,29 +1120,29 @@ struct Sharing_Nearby_PublicCertificate { } /// NEXT_ID=3 -struct Sharing_Nearby_WifiCredentials { +nonisolated struct Sharing_Nearby_WifiCredentials: Sendable { // 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. /// Wi-Fi password. var password: String { - get {return _password ?? String()} + get {_password ?? String()} set {_password = newValue} } /// Returns true if `password` has been explicitly set. - var hasPassword: Bool {return self._password != nil} + var hasPassword: Bool {self._password != nil} /// Clears the value of `password`. Subsequent reads from it will return its default value. mutating func clearPassword() {self._password = nil} /// True if the network is a hidden network that is not broadcasting its SSID. /// Default is false. var hiddenSsid: Bool { - get {return _hiddenSsid ?? false} + get {_hiddenSsid ?? false} set {_hiddenSsid = newValue} } /// Returns true if `hiddenSsid` has been explicitly set. - var hasHiddenSsid: Bool {return self._hiddenSsid != nil} + var hasHiddenSsid: Bool {self._hiddenSsid != nil} /// Clears the value of `hiddenSsid`. Subsequent reads from it will return its default value. mutating func clearHiddenSsid() {self._hiddenSsid = nil} @@ -1420,18 +1155,18 @@ struct Sharing_Nearby_WifiCredentials { } /// NEXT_ID=2 -struct Sharing_Nearby_StreamDetails { +nonisolated struct Sharing_Nearby_StreamDetails: Sendable { // 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. /// Serialized ParcelFileDescriptor for input stream (for the receiver). var inputStreamParcelFileDescriptorBytes: Data { - get {return _inputStreamParcelFileDescriptorBytes ?? Data()} + get {_inputStreamParcelFileDescriptorBytes ?? Data()} set {_inputStreamParcelFileDescriptorBytes = newValue} } /// Returns true if `inputStreamParcelFileDescriptorBytes` has been explicitly set. - var hasInputStreamParcelFileDescriptorBytes: Bool {return self._inputStreamParcelFileDescriptorBytes != nil} + var hasInputStreamParcelFileDescriptorBytes: Bool {self._inputStreamParcelFileDescriptorBytes != nil} /// Clears the value of `inputStreamParcelFileDescriptorBytes`. Subsequent reads from it will return its default value. mutating func clearInputStreamParcelFileDescriptorBytes() {self._inputStreamParcelFileDescriptorBytes = nil} @@ -1442,55 +1177,13 @@ struct Sharing_Nearby_StreamDetails { fileprivate var _inputStreamParcelFileDescriptorBytes: Data? = nil } -#if swift(>=5.5) && canImport(_Concurrency) -extension Sharing_Nearby_FileMetadata: @unchecked Sendable {} -extension Sharing_Nearby_FileMetadata.TypeEnum: @unchecked Sendable {} -extension Sharing_Nearby_TextMetadata: @unchecked Sendable {} -extension Sharing_Nearby_TextMetadata.TypeEnum: @unchecked Sendable {} -extension Sharing_Nearby_WifiCredentialsMetadata: @unchecked Sendable {} -extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: @unchecked Sendable {} -extension Sharing_Nearby_AppMetadata: @unchecked Sendable {} -extension Sharing_Nearby_StreamMetadata: @unchecked Sendable {} -extension Sharing_Nearby_Frame: @unchecked Sendable {} -extension Sharing_Nearby_Frame.Version: @unchecked Sendable {} -extension Sharing_Nearby_V1Frame: @unchecked Sendable {} -extension Sharing_Nearby_V1Frame.FrameType: @unchecked Sendable {} -extension Sharing_Nearby_IntroductionFrame: @unchecked Sendable {} -extension Sharing_Nearby_IntroductionFrame.SharingUseCase: @unchecked Sendable {} -extension Sharing_Nearby_ProgressUpdateFrame: @unchecked Sendable {} -extension Sharing_Nearby_ConnectionResponseFrame: @unchecked Sendable {} -extension Sharing_Nearby_ConnectionResponseFrame.Status: @unchecked Sendable {} -extension Sharing_Nearby_AttachmentDetails: @unchecked Sendable {} -extension Sharing_Nearby_AttachmentDetails.TypeEnum: @unchecked Sendable {} -extension Sharing_Nearby_FileAttachmentDetails: @unchecked Sendable {} -extension Sharing_Nearby_PayloadsDetails: @unchecked Sendable {} -extension Sharing_Nearby_PayloadDetails: @unchecked Sendable {} -extension Sharing_Nearby_PairedKeyEncryptionFrame: @unchecked Sendable {} -extension Sharing_Nearby_PairedKeyResultFrame: @unchecked Sendable {} -extension Sharing_Nearby_PairedKeyResultFrame.Status: @unchecked Sendable {} -extension Sharing_Nearby_CertificateInfoFrame: @unchecked Sendable {} -extension Sharing_Nearby_PublicCertificate: @unchecked Sendable {} -extension Sharing_Nearby_WifiCredentials: @unchecked Sendable {} -extension Sharing_Nearby_StreamDetails: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "sharing.nearby" +nonisolated fileprivate let _protobuf_package = "sharing.nearby" -extension Sharing_Nearby_FileMetadata: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_FileMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".FileMetadata" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "type"), - 3: .standard(proto: "payload_id"), - 4: .same(proto: "size"), - 5: .standard(proto: "mime_type"), - 6: .same(proto: "id"), - 7: .standard(proto: "parent_folder"), - 8: .standard(proto: "attachment_hash"), - 9: .standard(proto: "is_sensitive_content"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0\u{1}type\0\u{3}payload_id\0\u{1}size\0\u{3}mime_type\0\u{1}id\0\u{3}parent_folder\0\u{3}attachment_hash\0\u{3}is_sensitive_content\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1562,28 +1255,13 @@ extension Sharing_Nearby_FileMetadata: @preconcurrency SwiftProtobuf.Message, @p } } -extension Sharing_Nearby_FileMetadata.TypeEnum: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "IMAGE"), - 2: .same(proto: "VIDEO"), - 3: .same(proto: "ANDROID_APP"), - 4: .same(proto: "AUDIO"), - 5: .same(proto: "DOCUMENT"), - 6: .same(proto: "CONTACT_CARD"), - ] +nonisolated extension Sharing_Nearby_FileMetadata.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}IMAGE\0\u{1}VIDEO\0\u{1}ANDROID_APP\0\u{1}AUDIO\0\u{1}DOCUMENT\0\u{1}CONTACT_CARD\0") } -extension Sharing_Nearby_TextMetadata: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_TextMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".TextMetadata" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .standard(proto: "text_title"), - 3: .same(proto: "type"), - 4: .standard(proto: "payload_id"), - 5: .same(proto: "size"), - 6: .same(proto: "id"), - 7: .standard(proto: "is_sensitive_text"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}\u{2}text_title\0\u{1}type\0\u{3}payload_id\0\u{1}size\0\u{1}id\0\u{3}is_sensitive_text\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1640,24 +1318,13 @@ extension Sharing_Nearby_TextMetadata: @preconcurrency SwiftProtobuf.Message, @p } } -extension Sharing_Nearby_TextMetadata.TypeEnum: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "TEXT"), - 2: .same(proto: "URL"), - 3: .same(proto: "ADDRESS"), - 4: .same(proto: "PHONE_NUMBER"), - ] +nonisolated extension Sharing_Nearby_TextMetadata.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}TEXT\0\u{1}URL\0\u{1}ADDRESS\0\u{1}PHONE_NUMBER\0") } -extension Sharing_Nearby_WifiCredentialsMetadata: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_WifiCredentialsMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".WifiCredentialsMetadata" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .same(proto: "ssid"), - 3: .standard(proto: "security_type"), - 4: .standard(proto: "payload_id"), - 5: .same(proto: "id"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\u{2}ssid\0\u{3}security_type\0\u{3}payload_id\0\u{1}id\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1704,27 +1371,13 @@ extension Sharing_Nearby_WifiCredentialsMetadata: @preconcurrency SwiftProtobuf. } } -extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_SECURITY_TYPE"), - 1: .same(proto: "OPEN"), - 2: .same(proto: "WPA_PSK"), - 3: .same(proto: "WEP"), - 4: .same(proto: "SAE"), - ] +nonisolated extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_SECURITY_TYPE\0\u{1}OPEN\0\u{1}WPA_PSK\0\u{1}WEP\0\u{1}SAE\0") } -extension Sharing_Nearby_AppMetadata: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_AppMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AppMetadata" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "app_name"), - 2: .same(proto: "size"), - 3: .standard(proto: "payload_id"), - 4: .same(proto: "id"), - 5: .standard(proto: "file_name"), - 6: .standard(proto: "file_size"), - 7: .standard(proto: "package_name"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}app_name\0\u{1}size\0\u{3}payload_id\0\u{1}id\0\u{3}file_name\0\u{3}file_size\0\u{3}package_name\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1786,14 +1439,9 @@ extension Sharing_Nearby_AppMetadata: @preconcurrency SwiftProtobuf.Message, @pr } } -extension Sharing_Nearby_StreamMetadata: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_StreamMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".StreamMetadata" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "description"), - 2: .standard(proto: "package_name"), - 3: .standard(proto: "payload_id"), - 4: .standard(proto: "attributed_app_name"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}description\0\u{3}package_name\0\u{3}payload_id\0\u{3}attributed_app_name\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1840,12 +1488,9 @@ extension Sharing_Nearby_StreamMetadata: @preconcurrency SwiftProtobuf.Message, } } -extension Sharing_Nearby_Frame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_Frame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Frame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "version"), - 2: .same(proto: "v1"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}v1\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1882,24 +1527,13 @@ extension Sharing_Nearby_Frame: @preconcurrency SwiftProtobuf.Message, @preconcu } } -extension Sharing_Nearby_Frame.Version: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_VERSION"), - 1: .same(proto: "V1"), - ] +nonisolated extension Sharing_Nearby_Frame.Version: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_VERSION\0\u{1}V1\0") } -extension Sharing_Nearby_V1Frame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_V1Frame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".V1Frame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "introduction"), - 3: .standard(proto: "connection_response"), - 4: .standard(proto: "paired_key_encryption"), - 5: .standard(proto: "paired_key_result"), - 6: .standard(proto: "certificate_info"), - 7: .standard(proto: "progress_update"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{1}introduction\0\u{3}connection_response\0\u{3}paired_key_encryption\0\u{3}paired_key_result\0\u{3}certificate_info\0\u{3}progress_update\0") fileprivate class _StorageClass { var _type: Sharing_Nearby_V1Frame.FrameType? = nil @@ -1910,7 +1544,11 @@ extension Sharing_Nearby_V1Frame: @preconcurrency SwiftProtobuf.Message, @precon var _certificateInfo: Sharing_Nearby_CertificateInfoFrame? = nil var _progressUpdate: Sharing_Nearby_ProgressUpdateFrame? = nil - static let defaultInstance = _StorageClass() + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() private init() {} @@ -2005,32 +1643,13 @@ extension Sharing_Nearby_V1Frame: @preconcurrency SwiftProtobuf.Message, @precon } } -extension Sharing_Nearby_V1Frame.FrameType: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN_FRAME_TYPE"), - 1: .same(proto: "INTRODUCTION"), - 2: .same(proto: "RESPONSE"), - 3: .same(proto: "PAIRED_KEY_ENCRYPTION"), - 4: .same(proto: "PAIRED_KEY_RESULT"), - 5: .same(proto: "CERTIFICATE_INFO"), - 6: .same(proto: "CANCEL"), - 7: .same(proto: "PROGRESS_UPDATE"), - ] +nonisolated extension Sharing_Nearby_V1Frame.FrameType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_FRAME_TYPE\0\u{1}INTRODUCTION\0\u{1}RESPONSE\0\u{1}PAIRED_KEY_ENCRYPTION\0\u{1}PAIRED_KEY_RESULT\0\u{1}CERTIFICATE_INFO\0\u{1}CANCEL\0\u{1}PROGRESS_UPDATE\0") } -extension Sharing_Nearby_IntroductionFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_IntroductionFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".IntroductionFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "file_metadata"), - 2: .standard(proto: "text_metadata"), - 3: .standard(proto: "required_package"), - 4: .standard(proto: "wifi_credentials_metadata"), - 5: .standard(proto: "app_metadata"), - 6: .standard(proto: "start_transfer"), - 7: .standard(proto: "stream_metadata"), - 8: .standard(proto: "use_case"), - 9: .standard(proto: "preview_payload_ids"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}file_metadata\0\u{3}text_metadata\0\u{3}required_package\0\u{3}wifi_credentials_metadata\0\u{3}app_metadata\0\u{3}start_transfer\0\u{3}stream_metadata\0\u{3}use_case\0\u{3}preview_payload_ids\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2102,20 +1721,13 @@ extension Sharing_Nearby_IntroductionFrame: @preconcurrency SwiftProtobuf.Messag } } -extension Sharing_Nearby_IntroductionFrame.SharingUseCase: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "NEARBY_SHARE"), - 2: .same(proto: "REMOTE_COPY"), - ] +nonisolated extension Sharing_Nearby_IntroductionFrame.SharingUseCase: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}NEARBY_SHARE\0\u{1}REMOTE_COPY\0") } -extension Sharing_Nearby_ProgressUpdateFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_ProgressUpdateFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ProgressUpdateFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "progress"), - 2: .standard(proto: "start_transfer"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}progress\0\u{3}start_transfer\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2152,13 +1764,9 @@ extension Sharing_Nearby_ProgressUpdateFrame: @preconcurrency SwiftProtobuf.Mess } } -extension Sharing_Nearby_ConnectionResponseFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_ConnectionResponseFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ConnectionResponseFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "status"), - 2: .standard(proto: "attachment_details"), - 3: .standard(proto: "stream_metadata"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}status\0\u{3}attachment_details\0\u{3}stream_metadata\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2200,23 +1808,13 @@ extension Sharing_Nearby_ConnectionResponseFrame: @preconcurrency SwiftProtobuf. } } -extension Sharing_Nearby_ConnectionResponseFrame.Status: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "ACCEPT"), - 2: .same(proto: "REJECT"), - 3: .same(proto: "NOT_ENOUGH_SPACE"), - 4: .same(proto: "UNSUPPORTED_ATTACHMENT_TYPE"), - 5: .same(proto: "TIMED_OUT"), - ] +nonisolated extension Sharing_Nearby_ConnectionResponseFrame.Status: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}ACCEPT\0\u{1}REJECT\0\u{1}NOT_ENOUGH_SPACE\0\u{1}UNSUPPORTED_ATTACHMENT_TYPE\0\u{1}TIMED_OUT\0") } -extension Sharing_Nearby_AttachmentDetails: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_AttachmentDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".AttachmentDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .standard(proto: "file_attachment_details"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}file_attachment_details\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2253,23 +1851,13 @@ extension Sharing_Nearby_AttachmentDetails: @preconcurrency SwiftProtobuf.Messag } } -extension Sharing_Nearby_AttachmentDetails.TypeEnum: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "FILE"), - 2: .same(proto: "TEXT"), - 3: .same(proto: "WIFI_CREDENTIALS"), - 4: .same(proto: "APP"), - 5: .same(proto: "STREAM"), - ] +nonisolated extension Sharing_Nearby_AttachmentDetails.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}FILE\0\u{1}TEXT\0\u{1}WIFI_CREDENTIALS\0\u{1}APP\0\u{1}STREAM\0") } -extension Sharing_Nearby_FileAttachmentDetails: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_FileAttachmentDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".FileAttachmentDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "receiver_existing_file_size"), - 2: .standard(proto: "attachment_hash_payloads"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}receiver_existing_file_size\0\u{3}attachment_hash_payloads\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2306,11 +1894,9 @@ extension Sharing_Nearby_FileAttachmentDetails: @preconcurrency SwiftProtobuf.Me } } -extension Sharing_Nearby_PayloadsDetails: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_PayloadsDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PayloadsDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "payload_details"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payload_details\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2338,13 +1924,9 @@ extension Sharing_Nearby_PayloadsDetails: @preconcurrency SwiftProtobuf.Message, } } -extension Sharing_Nearby_PayloadDetails: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_PayloadDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PayloadDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .standard(proto: "creation_timestamp_millis"), - 3: .same(proto: "size"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{3}creation_timestamp_millis\0\u{1}size\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2386,14 +1968,9 @@ extension Sharing_Nearby_PayloadDetails: @preconcurrency SwiftProtobuf.Message, } } -extension Sharing_Nearby_PairedKeyEncryptionFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_PairedKeyEncryptionFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PairedKeyEncryptionFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "signed_data"), - 2: .standard(proto: "secret_id_hash"), - 3: .standard(proto: "optional_signed_data"), - 4: .standard(proto: "qr_code_handshake_data"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}signed_data\0\u{3}secret_id_hash\0\u{3}optional_signed_data\0\u{3}qr_code_handshake_data\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2440,12 +2017,9 @@ extension Sharing_Nearby_PairedKeyEncryptionFrame: @preconcurrency SwiftProtobuf } } -extension Sharing_Nearby_PairedKeyResultFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_PairedKeyResultFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PairedKeyResultFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "status"), - 2: .standard(proto: "os_type"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}status\0\u{3}os_type\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2482,20 +2056,13 @@ extension Sharing_Nearby_PairedKeyResultFrame: @preconcurrency SwiftProtobuf.Mes } } -extension Sharing_Nearby_PairedKeyResultFrame.Status: @preconcurrency SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "SUCCESS"), - 2: .same(proto: "FAIL"), - 3: .same(proto: "UNABLE"), - ] +nonisolated extension Sharing_Nearby_PairedKeyResultFrame.Status: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}SUCCESS\0\u{1}FAIL\0\u{1}UNABLE\0") } -extension Sharing_Nearby_CertificateInfoFrame: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_CertificateInfoFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".CertificateInfoFrame" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "public_certificate"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_certificate\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2523,17 +2090,9 @@ extension Sharing_Nearby_CertificateInfoFrame: @preconcurrency SwiftProtobuf.Mes } } -extension Sharing_Nearby_PublicCertificate: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_PublicCertificate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PublicCertificate" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "secret_id"), - 2: .standard(proto: "authenticity_key"), - 3: .standard(proto: "public_key"), - 4: .standard(proto: "start_time"), - 5: .standard(proto: "end_time"), - 6: .standard(proto: "encrypted_metadata_bytes"), - 7: .standard(proto: "metadata_encryption_key_tag"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}secret_id\0\u{3}authenticity_key\0\u{3}public_key\0\u{3}start_time\0\u{3}end_time\0\u{3}encrypted_metadata_bytes\0\u{3}metadata_encryption_key_tag\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2595,12 +2154,9 @@ extension Sharing_Nearby_PublicCertificate: @preconcurrency SwiftProtobuf.Messag } } -extension Sharing_Nearby_WifiCredentials: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_WifiCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".WifiCredentials" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "password"), - 2: .standard(proto: "hidden_ssid"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}password\0\u{3}hidden_ssid\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2637,11 +2193,9 @@ extension Sharing_Nearby_WifiCredentials: @preconcurrency SwiftProtobuf.Message, } } -extension Sharing_Nearby_StreamDetails: @preconcurrency SwiftProtobuf.Message, @preconcurrency SwiftProtobuf._MessageImplementationBase, @preconcurrency SwiftProtobuf._ProtoNameProviding { +nonisolated extension Sharing_Nearby_StreamDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".StreamDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "input_stream_parcel_file_descriptor_bytes"), - ] + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}input_stream_parcel_file_descriptor_bytes\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/device_to_device_messages.proto b/airsync-mac/Core/QuickShare/ProtobufSource/device_to_device_messages.proto new file mode 100644 index 00000000..5600373e --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/device_to_device_messages.proto @@ -0,0 +1,81 @@ +// Copyright 2020 Google LLC +// +// Licensed 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 +// +// https://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. + +syntax = "proto2"; + +package securegcm; + +import "securemessage.proto"; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.security.cryptauth.lib.securegcm"; +option java_outer_classname = "DeviceToDeviceMessagesProto"; +option objc_class_prefix = "SGCM"; + +// Used by protocols between devices +message DeviceToDeviceMessage { + // the payload of the message + optional bytes message = 1; + + // the sequence number of the message - must be increasing. + optional int32 sequence_number = 2; +} + +// sent as the first message from initiator to responder +// in an unauthenticated Diffie-Hellman Key Exchange +message InitiatorHello { + // The session public key to send to the responder + optional securemessage.GenericPublicKey public_dh_key = 1; + + // The protocol version + optional int32 protocol_version = 2 [default = 0]; +} + +// sent inside the header of the first message from the responder to the +// initiator in an unauthenticated Diffie-Hellman Key Exchange +message ResponderHello { + // The session public key to send to the initiator + optional securemessage.GenericPublicKey public_dh_key = 1; + + // The protocol version + optional int32 protocol_version = 2 [default = 0]; +} + +// Type of curve +enum Curve { ED_25519 = 1; } + +// A convenience proto for encoding curve points in affine representation +message EcPoint { + required Curve curve = 1; + + // x and y are encoded in big-endian two's complement + // client MUST verify (x,y) is a valid point on the specified curve + required bytes x = 2; + required bytes y = 3; +} + +message SpakeHandshakeMessage { + // Each flow in the protocol bumps this counter + optional int32 flow_number = 1; + + // Some (but not all) SPAKE flows send a point on an elliptic curve + optional EcPoint ec_point = 2; + + // Some (but not all) SPAKE flows send a hash value + optional bytes hash_value = 3; + + // The last flow of a SPAKE protocol can send an optional payload, + // since the key exchange is already complete on the sender's side. + optional bytes payload = 4; +} diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/offline_wire_formats.proto b/airsync-mac/Core/QuickShare/ProtobufSource/offline_wire_formats.proto new file mode 100644 index 00000000..afd0ed70 --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/offline_wire_formats.proto @@ -0,0 +1,596 @@ +// Copyright 2020 Google LLC +// +// Licensed 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 +// +// https://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. + +syntax = "proto2"; + +package location.nearby.connections; + +// import "storage/datapol/annotations/proto/semantic_annotations.proto"; + +option optimize_for = LITE_RUNTIME; +option java_outer_classname = "OfflineWireFormatsProto"; +option java_package = "com.google.location.nearby.connections.proto"; +option objc_class_prefix = "GNCP"; + +message OfflineFrame { + enum Version { + UNKNOWN_VERSION = 0; + V1 = 1; + } + optional Version version = 1; + + // Right now there's only 1 version, but if there are more, exactly one of + // the following fields will be set. + optional V1Frame v1 = 2; +} + +message V1Frame { + enum FrameType { + UNKNOWN_FRAME_TYPE = 0; + CONNECTION_REQUEST = 1; + CONNECTION_RESPONSE = 2; + PAYLOAD_TRANSFER = 3; + BANDWIDTH_UPGRADE_NEGOTIATION = 4; + KEEP_ALIVE = 5; + DISCONNECTION = 6; + PAIRED_KEY_ENCRYPTION = 7; + AUTHENTICATION_MESSAGE = 8; + AUTHENTICATION_RESULT = 9; + AUTO_RESUME = 10; + AUTO_RECONNECT = 11; + BANDWIDTH_UPGRADE_RETRY = 12; + } + optional FrameType type = 1; + + // Exactly one of the following fields will be set. + optional ConnectionRequestFrame connection_request = 2; + optional ConnectionResponseFrame connection_response = 3; + optional PayloadTransferFrame payload_transfer = 4; + optional BandwidthUpgradeNegotiationFrame bandwidth_upgrade_negotiation = 5; + optional KeepAliveFrame keep_alive = 6; + optional DisconnectionFrame disconnection = 7; + optional PairedKeyEncryptionFrame paired_key_encryption = 8; + optional AuthenticationMessageFrame authentication_message = 9; + optional AuthenticationResultFrame authentication_result = 10; + optional AutoResumeFrame auto_resume = 11; + optional AutoReconnectFrame auto_reconnect = 12; + optional BandwidthUpgradeRetryFrame bandwidth_upgrade_retry = 13; +} + +message ConnectionRequestFrame { + // Should always match cs/symbol:location.nearby.proto.connections.Medium + // LINT.IfChange + enum Medium { + UNKNOWN_MEDIUM = 0; + MDNS = 1 [deprecated = true]; + BLUETOOTH = 2; + WIFI_HOTSPOT = 3; + BLE = 4; + WIFI_LAN = 5; + WIFI_AWARE = 6; + NFC = 7; + WIFI_DIRECT = 8; + WEB_RTC = 9; + BLE_L2CAP = 10; + USB = 11; + WEB_RTC_NON_CELLULAR = 12; + AWDL = 13; + } + // LINT.ThenChange(//depot/google3/third_party/nearby/proto/connections_enums.proto) + + // LINT.IfChange + enum ConnectionMode { + LEGACY = 0; + INSTANT = 1; + } + // LINT.ThenChange(//depot/google3/third_party/nearby/proto/connections_enums.proto) + + optional string endpoint_id = 1; + optional string endpoint_name = 2; + optional bytes handshake_data = 3; + // A random number generated for each outgoing connection that is presently + // used to act as a tiebreaker when 2 devices connect to each other + // simultaneously; this can also be used for other initialization-scoped + // things in the future. + optional int32 nonce = 4; + // The mediums this device supports upgrading to. This list should be filtered + // by both the strategy and this device's individual limitations. + repeated Medium mediums = 5; + optional bytes endpoint_info = 6; + optional MediumMetadata medium_metadata = 7; + optional int32 keep_alive_interval_millis = 8; + optional int32 keep_alive_timeout_millis = 9; + // The type of {@link Device} object. + optional int32 device_type = 10 [default = 0, deprecated = true]; + // The bytes of serialized {@link Device} object. + optional bytes device_info = 11 [deprecated = true]; + // Represents the {@link Device} that invokes the request. + oneof Device { + ConnectionsDevice connections_device = 12; + PresenceDevice presence_device = 13; + } + optional ConnectionMode connection_mode = 14; + optional LocationHint location_hint = 15; +} + +message ConnectionResponseFrame { + // This doesn't need to send back endpoint_id and endpoint_name (like + // the ConnectionRequestFrame does) because those have already been + // transmitted out-of-band, at the time this endpoint was discovered. + + // One of: + // + // - ConnectionsStatusCodes.STATUS_OK + // - ConnectionsStatusCodes.STATUS_CONNECTION_REJECTED. + optional int32 status = 1 [deprecated = true]; + optional bytes handshake_data = 2; + + // Used to replace the status integer parameter with a meaningful enum item. + // Map ConnectionsStatusCodes.STATUS_OK to ACCEPT and + // ConnectionsStatusCodes.STATUS_CONNECTION_REJECTED to REJECT. + // Flag: connection_replace_status_with_response_connectionResponseFrame + enum ResponseStatus { + UNKNOWN_RESPONSE_STATUS = 0; + ACCEPT = 1; + REJECT = 2; + } + optional ResponseStatus response = 3; + optional OsInfo os_info = 4; + // A bitmask value to indicate which medium supports Multiplex transmission + // feature. Each supporting medium could utilize one bit starting from the + // least significant bit in this field. eq. BT utilizes the LSB bit which 0x01 + // means bt supports multiplex while 0x00 means not. Refer to ClientProxy.java + // for the bit usages. + optional int32 multiplex_socket_bitmask = 5; + optional int32 nearby_connections_version = 6 [deprecated = true]; + optional int32 safe_to_disconnect_version = 7; + optional LocationHint location_hint = 8; + optional int32 keep_alive_timeout_millis = 9; +} + +message PayloadTransferFrame { + enum PacketType { + UNKNOWN_PACKET_TYPE = 0; + DATA = 1; + CONTROL = 2; + PAYLOAD_ACK = 3; + } + + message PayloadHeader { + enum PayloadType { + UNKNOWN_PAYLOAD_TYPE = 0; + BYTES = 1; + FILE = 2; + STREAM = 3; + } + optional int64 id = 1; + optional PayloadType type = 2; + optional int64 total_size = 3; + optional bool is_sensitive = 4; + optional string file_name = 5; + optional string parent_folder = 6; + // Time since the epoch in milliseconds. + optional int64 last_modified_timestamp_millis = 7; + } + + // Accompanies DATA packets. + message PayloadChunk { + enum Flags { + LAST_CHUNK = 0x1; + } + optional int32 flags = 1; + optional int64 offset = 2; + optional bytes body = 3; + optional int32 index = 4; + } + + // Accompanies CONTROL packets. + message ControlMessage { + enum EventType { + UNKNOWN_EVENT_TYPE = 0; + PAYLOAD_ERROR = 1; + PAYLOAD_CANCELED = 2; + // Use PacketType.PAYLOAD_ACK instead + PAYLOAD_RECEIVED_ACK = 3 [deprecated = true]; + } + + optional EventType event = 1; + optional int64 offset = 2; + } + + optional PacketType packet_type = 1; + optional PayloadHeader payload_header = 2; + + // Exactly one of the following fields will be set, depending on the type. + optional PayloadChunk payload_chunk = 3; + optional ControlMessage control_message = 4; +} + +message BandwidthUpgradeNegotiationFrame { + enum EventType { + UNKNOWN_EVENT_TYPE = 0; + UPGRADE_PATH_AVAILABLE = 1; + LAST_WRITE_TO_PRIOR_CHANNEL = 2; + SAFE_TO_CLOSE_PRIOR_CHANNEL = 3; + CLIENT_INTRODUCTION = 4; + UPGRADE_FAILURE = 5; + CLIENT_INTRODUCTION_ACK = 6; + // The event type that requires the remote device to send the available + // upgrade path. + UPGRADE_PATH_REQUEST = 7; + } + + // Accompanies UPGRADE_PATH_AVAILABLE and UPGRADE_FAILURE events. + message UpgradePathInfo { + // Should always match cs/symbol:location.nearby.proto.connections.Medium + enum Medium { + UNKNOWN_MEDIUM = 0; + MDNS = 1 [deprecated = true]; + BLUETOOTH = 2; + WIFI_HOTSPOT = 3; + BLE = 4; + WIFI_LAN = 5; + WIFI_AWARE = 6; + NFC = 7; + WIFI_DIRECT = 8; + WEB_RTC = 9; + // 10 is reserved. + USB = 11; + WEB_RTC_NON_CELLULAR = 12; + AWDL = 13; + } + + // Accompanies Medium.WIFI_HOTSPOT. + message WifiHotspotCredentials { + optional string ssid = 1; + optional string password = 2 + /* type = ST_ACCOUNT_CREDENTIAL */; + optional int32 port = 3; + optional string gateway = 4 [default = "0.0.0.0"]; + // This field can be a band or frequency + optional int32 frequency = 5 [default = -1]; + } + + // Accompanies Medium.WIFI_LAN. + message WifiLanSocket { + optional bytes ip_address = 1; + optional int32 wifi_port = 2; + } + + // Accompanies Medium.BLUETOOTH. + message BluetoothCredentials { + optional string service_name = 1; + optional string mac_address = 2; + } + + // Accompanies Medium.WIFI_AWARE. + message WifiAwareCredentials { + optional string service_id = 1; + optional bytes service_info = 2; + optional string password = 3 + /* type = ST_ACCOUNT_CREDENTIAL */; + } + + // Accompanies Medium.WIFI_DIRECT. + message WifiDirectCredentials { + optional string ssid = 1; + optional string password = 2 + /* type = ST_ACCOUNT_CREDENTIAL */; + optional int32 port = 3; + optional int32 frequency = 4; + optional string gateway = 5 [default = "0.0.0.0"]; + // IPv6 link-local address, network order (128bits). + // The GO should listen on both IPv4 and IPv6 addresses. + // https://en.wikipedia.org/wiki/Link-local_address#IPv6 + optional bytes ip_v6_address = 6; + } + + // Accompanies Medium.WEB_RTC + message WebRtcCredentials { + optional string peer_id = 1; + optional LocationHint location_hint = 2; + } + + // Accompanies Medium.AWDL. + message AwdlCredentials { + optional string service_name = 1; + optional string service_type = 2; + optional string password = 3 + /* type = ST_ACCOUNT_CREDENTIAL */; + } + + message UpgradePathRequest { + // Supported mediums on the advertiser device. + repeated Medium mediums = 1 [packed = true]; + optional MediumMetadata medium_meta_data = 2; + } + + optional Medium medium = 1; + + // Exactly one of the following fields will be set. + optional WifiHotspotCredentials wifi_hotspot_credentials = 2; + optional WifiLanSocket wifi_lan_socket = 3; + optional BluetoothCredentials bluetooth_credentials = 4; + optional WifiAwareCredentials wifi_aware_credentials = 5; + optional WifiDirectCredentials wifi_direct_credentials = 6; + optional WebRtcCredentials web_rtc_credentials = 8; + optional AwdlCredentials awdl_credentials = 11; + + // Disable Encryption for this upgrade medium to improve throughput. + optional bool supports_disabling_encryption = 7; + + // An ack will be sent after the CLIENT_INTRODUCTION frame. + optional bool supports_client_introduction_ack = 9; + + optional UpgradePathRequest upgrade_path_request = 10; + } + + // Accompanies SAFE_TO_CLOSE_PRIOR_CHANNEL events. + message SafeToClosePriorChannel { + optional int32 sta_frequency = 1; + } + + // Accompanies CLIENT_INTRODUCTION events. + message ClientIntroduction { + optional string endpoint_id = 1; + optional bool supports_disabling_encryption = 2; + optional string last_endpoint_id = 3; + } + + // Accompanies CLIENT_INTRODUCTION_ACK events. + message ClientIntroductionAck {} + + optional EventType event_type = 1; + + // Exactly one of the following fields will be set. + optional UpgradePathInfo upgrade_path_info = 2; + optional ClientIntroduction client_introduction = 3; + optional ClientIntroductionAck client_introduction_ack = 4; + optional SafeToClosePriorChannel safe_to_close_prior_channel = 5; +} + +message BandwidthUpgradeRetryFrame { + // Should always match cs/symbol:location.nearby.proto.connections.Medium + // LINT.IfChange + enum Medium { + UNKNOWN_MEDIUM = 0; + // 1 is reserved. + BLUETOOTH = 2; + WIFI_HOTSPOT = 3; + BLE = 4; + WIFI_LAN = 5; + WIFI_AWARE = 6; + NFC = 7; + WIFI_DIRECT = 8; + WEB_RTC = 9; + BLE_L2CAP = 10; + USB = 11; + WEB_RTC_NON_CELLULAR = 12; + AWDL = 13; + } + // LINT.ThenChange(//depot/google3/third_party/nearby/proto/connections_enums.proto) + + // The mediums this device supports upgrading to. This list should be filtered + // by both the strategy and this device's individual limitations. + repeated Medium supported_medium = 1; + + // If true, expect the remote endpoint to send back the latest + // supported_medium. + optional bool is_request = 2; +} + +message KeepAliveFrame { + // And ack will be sent after receiving KEEP_ALIVE frame. + optional bool ack = 1; + // The sequence number + optional uint32 seq_num = 2; +} + +// Informs the remote side to immediately severe the socket connection. +// Used in bandwidth upgrades to get around a race condition, but may be used +// in other situations to trigger a faster disconnection event than waiting for +// socket closed on the remote side. +message DisconnectionFrame { + // Apply safe-to-disconnect protocol if true. + optional bool request_safe_to_disconnect = 1; + + // Ack of receiving Disconnection frame will be sent to the sender + // frame. + optional bool ack_safe_to_disconnect = 2; +} + +// A paired key encryption packet sent between devices, contains signed data. +message PairedKeyEncryptionFrame { + // The encrypted data (raw authentication token for the established + // connection) in byte array format. + optional bytes signed_data = 1; +} + +// Nearby Connections authentication frame, contains the bytes format of a +// DeviceProvider's authentication message. +message AuthenticationMessageFrame { + // An auth message generated by DeviceProvider. + // To be sent to the remote device for verification during connection setups. + optional bytes auth_message = 1; +} + +// Nearby Connections authentication result frame. +message AuthenticationResultFrame { + // The authentication result. Non null if this frame is used to exchange + // authentication result. + optional int32 result = 1; +} + +message AutoResumeFrame { + enum EventType { + UNKNOWN_AUTO_RESUME_EVENT_TYPE = 0; + PAYLOAD_RESUME_TRANSFER_START = 1; + PAYLOAD_RESUME_TRANSFER_ACK = 2; + } + + optional EventType event_type = 1; + optional int64 pending_payload_id = 2; + optional int32 next_payload_chunk_index = 3; + optional int32 version = 4; +} + +message AutoReconnectFrame { + enum EventType { + UNKNOWN_EVENT_TYPE = 0; + CLIENT_INTRODUCTION = 1; + CLIENT_INTRODUCTION_ACK = 2; + } + optional string endpoint_id = 1; + optional EventType event_type = 2; + optional string last_endpoint_id = 3; +} + +message MediumMetadata { + // True if local device supports 5GHz. + optional bool supports_5_ghz = 1; + // WiFi LAN BSSID, in the form of a six-byte MAC address: XX:XX:XX:XX:XX:XX + optional string bssid = 2; + // IP address, in network byte order: the highest order byte of the address is + // in byte[0]. + optional bytes ip_address = 3; + // True if local device supports 6GHz. + optional bool supports_6_ghz = 4; + // True if local device has mobile radio. + optional bool mobile_radio = 5; + // The frequency of the WiFi LAN AP(in MHz). Or -1 is not associated with an + // AP over WiFi, -2 represents the active network uses an Ethernet transport. + optional int32 ap_frequency = 6 [default = -1]; + // Available channels on the local device. + optional AvailableChannels available_channels = 7; + // Usable WiFi Direct client channels on the local device. + optional WifiDirectCliUsableChannels wifi_direct_cli_usable_channels = 8; + // Usable WiFi LAN channels on the local device. + optional WifiLanUsableChannels wifi_lan_usable_channels = 9; + // Usable WiFi Aware channels on the local device. + optional WifiAwareUsableChannels wifi_aware_usable_channels = 10; + // Usable WiFi Hotspot STA channels on the local device. + optional WifiHotspotStaUsableChannels wifi_hotspot_sta_usable_channels = 11; + // The supported medium roles. + optional MediumRole medium_role = 12; +} + +// Available channels on the local device. +message AvailableChannels { + repeated int32 channels = 1 [packed = true]; +} + +// Usable WiFi Direct client channels on the local device. +message WifiDirectCliUsableChannels { + repeated int32 channels = 1 [packed = true]; +} + +// Usable WiFi LAN channels on the local device. +message WifiLanUsableChannels { + repeated int32 channels = 1 [packed = true]; +} + +// Usable WiFi Aware channels on the local device. +message WifiAwareUsableChannels { + repeated int32 channels = 1 [packed = true]; +} + +// Usable WiFi Hotspot STA channels on the local device. +message WifiHotspotStaUsableChannels { + repeated int32 channels = 1 [packed = true]; +} + +// The medium roles. +message MediumRole { + optional bool support_wifi_direct_group_owner = 1; + optional bool support_wifi_direct_group_client = 2; + optional bool support_wifi_hotspot_host = 3; + optional bool support_wifi_hotspot_client = 4; + optional bool support_wifi_aware_publisher = 5; + optional bool support_wifi_aware_subscriber = 6; + optional bool support_awdl_publisher = 7; + optional bool support_awdl_subscriber = 8; +} + +// LocationHint is used to specify a location as well as format. +message LocationHint { + // Location is the location, provided in the format specified by format. + optional string location = 1; + + // the format of location. + optional LocationStandard.Format format = 2; +} + +message LocationStandard { + enum Format { + UNKNOWN = 0; + // E164 country codes: + // https://en.wikipedia.org/wiki/List_of_country_calling_codes + // e.g. +1 for USA + E164_CALLING = 1; + + // ISO 3166-1 alpha-2 country codes: + // https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + ISO_3166_1_ALPHA_2 = 2; + } +} + +// Device capability for OS information. +message OsInfo { + enum OsType { + UNKNOWN_OS_TYPE = 0; + ANDROID = 1; + CHROME_OS = 2; + WINDOWS = 3; + APPLE = 4; + LINUX = 100; // g3 test environment + } + + optional OsType type = 1; +} + +enum EndpointType { + UNKNOWN_ENDPOINT = 0; + CONNECTIONS_ENDPOINT = 1; + PRESENCE_ENDPOINT = 2; +} + +message ConnectionsDevice { + optional string endpoint_id = 1; + optional EndpointType endpoint_type = 2; + optional bytes connectivity_info_list = 3; // Data Elements. + optional bytes endpoint_info = 4; +} + +message PresenceDevice { + enum DeviceType { + UNKNOWN = 0; + PHONE = 1; + TABLET = 2; + DISPLAY = 3; + LAPTOP = 4; + TV = 5; + WATCH = 6; + } + + optional string endpoint_id = 1; + optional EndpointType endpoint_type = 2; + optional bytes connectivity_info_list = 3; // Data Elements. + optional int64 device_id = 4; + optional string device_name = 5; + optional DeviceType device_type = 6; + optional string device_image_url = 7; + repeated ConnectionRequestFrame.Medium discovery_medium = 8 [packed = true]; + repeated int32 actions = 9 [packed = true]; + repeated int64 identity_type = 10 [packed = true]; +} diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/securegcm.proto b/airsync-mac/Core/QuickShare/ProtobufSource/securegcm.proto new file mode 100644 index 00000000..0325f06e --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/securegcm.proto @@ -0,0 +1,308 @@ +// Copyright 2020 Google LLC +// +// Licensed 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 +// +// https://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. + +syntax = "proto2"; + +package securegcm; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.security.cryptauth.lib.securegcm"; +option java_outer_classname = "SecureGcmProto"; +option objc_class_prefix = "SGCM"; + +// Message used only during enrollment +// Field numbers should be kept in sync with DeviceInfo in: +// java/com/google/security/cryptauth/backend/services/common/common.proto +message GcmDeviceInfo { + // This field's name does not match the one in DeviceInfo for legacy reasons. + // Consider using long_device_id and device_type instead when enrolling + // non-android devices. + optional fixed64 android_device_id = 1; + + // Used for device_address of DeviceInfo field 2, but for GCM capable devices. + optional bytes gcm_registration_id = 102; + + // Used for device_address of DeviceInfo field 2, but for iOS devices. + optional bytes apn_registration_id = 202; + + // Does the user have notifications enabled for the given device address. + optional bool notification_enabled = 203 [default = true]; + + // Used for device_address of DeviceInfo field 2, a Bluetooth Mac address for + // the device (e.g., to be used with EasyUnlock) + optional string bluetooth_mac_address = 302; + + // SHA-256 hash of the device master key (from the key exchange). + // Differs from DeviceInfo field 3, which contains the actual master key. + optional bytes device_master_key_hash = 103; + + // A SecureMessage.EcP256PublicKey + required bytes user_public_key = 4; + + // device's model name + // (e.g., an android.os.Build.MODEL or UIDevice.model) + optional string device_model = 7; + + // device's locale + optional string locale = 8; + + // The handle for user_public_key (and implicitly, a master key) + optional bytes key_handle = 9; + + // The initial counter value for the device, sent by the device + optional int64 counter = 12 [default = 0]; + + // The Operating System version on the device + // (e.g., an android.os.Build.DISPLAY or UIDevice.systemVersion) + optional string device_os_version = 13; + + // The Operating System version number on the device + // (e.g., an android.os.Build.VERSION.SDK_INT) + optional int64 device_os_version_code = 14; + + // The Operating System release on the device + // (e.g., an android.os.Build.VERSION.RELEASE) + optional string device_os_release = 15; + + // The Operating System codename on the device + // (e.g., an android.os.Build.VERSION.CODENAME or UIDevice.systemName) + optional string device_os_codename = 16; + + // The software version running on the device + // (e.g., Authenticator app version string) + optional string device_software_version = 17; + + // The software version number running on the device + // (e.g., Authenticator app version code) + optional int64 device_software_version_code = 18; + + // Software package information if applicable + // (e.g., com.google.android.apps.authenticator2) + optional string device_software_package = 19; + + // Size of the display in thousandths of an inch (e.g., 7000 mils = 7 in) + optional int32 device_display_diagonal_mils = 22; + + // For Authzen capable devices, their Authzen protocol version + optional int32 device_authzen_version = 24; + + // Not all devices have device identifiers that fit in 64 bits. + optional bytes long_device_id = 29; + + // The device manufacturer name + // (e.g., android.os.Build.MANUFACTURER) + optional string device_manufacturer = 31; + + // Used to indicate which type of device this is. + optional DeviceType device_type = 32 [default = ANDROID]; + + // Fields corresponding to screenlock type/features and hardware features + // should be numbered in the 400 range. + + // Is this device using a secure screenlock (e.g., pattern or pin unlock) + optional bool using_secure_screenlock = 400 [default = false]; + + // Is auto-unlocking the screenlock (e.g., when at "home") supported? + optional bool auto_unlock_screenlock_supported = 401 [default = false]; + + // Is auto-unlocking the screenlock (e.g., when at "home") enabled? + optional bool auto_unlock_screenlock_enabled = 402 [default = false]; + + // Does the device have a Bluetooth (classic) radio? + optional bool bluetooth_radio_supported = 403 [default = false]; + + // Is the Bluetooth (classic) radio on? + optional bool bluetooth_radio_enabled = 404 [default = false]; + + // Does the device hardware support a mobile data connection? + optional bool mobile_data_supported = 405 [default = false]; + + // Does the device support tethering? + optional bool tethering_supported = 406 [default = false]; + + // Does the device have a BLE radio? + optional bool ble_radio_supported = 407 [default = false]; + + // Is the device a "Pixel Experience" Android device? + optional bool pixel_experience = 408 [default = false]; + + // Is the device running in the ARC++ container on a chromebook? + optional bool arc_plus_plus = 409 [default = false]; + + // Is the value set in |using_secure_screenlock| reliable? On some Android + // devices, the platform API to get the screenlock state is not trustworthy. + // See b/32212161. + optional bool is_screenlock_state_flaky = 410 [default = false]; + + // A list of multi-device software features supported by the device. + repeated SoftwareFeature supported_software_features = 411; + + // A list of multi-device software features currently enabled (active) on the + // device. + repeated SoftwareFeature enabled_software_features = 412; + + // The enrollment session id this is sent with + optional bytes enrollment_session_id = 1000; + + // A copy of the user's OAuth token + optional string oauth_token = 1001; +} + +// This enum is used by iOS devices as values for device_display_diagonal_mils +// in GcmDeviceInfo. There is no good way to calculate it on those devices. +enum AppleDeviceDiagonalMils { + // This is the mils diagonal on an iPhone 5. + APPLE_PHONE = 4000; + // This is the mils diagonal on an iPad mini. + APPLE_PAD = 7900; +} + +// This should be kept in sync with DeviceType in: +// java/com/google/security/cryptauth/backend/services/common/common_enums.proto +enum DeviceType { + UNKNOWN = 0; + ANDROID = 1; + CHROME = 2; + IOS = 3; + BROWSER = 4; + OSX = 5; +} + +// MultiDevice features which may be supported and enabled on a device. See +enum SoftwareFeature { + UNKNOWN_FEATURE = 0; + BETTER_TOGETHER_HOST = 1; + BETTER_TOGETHER_CLIENT = 2; + EASY_UNLOCK_HOST = 3; + EASY_UNLOCK_CLIENT = 4; + MAGIC_TETHER_HOST = 5; + MAGIC_TETHER_CLIENT = 6; + SMS_CONNECT_HOST = 7; + SMS_CONNECT_CLIENT = 8; +} + +// A list of "reasons" that can be provided for calling server-side APIs. +// This is particularly important for calls that can be triggered by different +// kinds of events. Please try to keep reasons as generic as possible, so that +// codes can be re-used by various callers in a sensible fashion. +enum InvocationReason { + REASON_UNKNOWN = 0; + // First run of the software package invoking this call + REASON_INITIALIZATION = 1; + // Ordinary periodic actions (e.g. monthly master key rotation) + REASON_PERIODIC = 2; + // Slow-cycle periodic action (e.g. yearly keypair rotation???) + REASON_SLOW_PERIODIC = 3; + // Fast-cycle periodic action (e.g. daily sync for Smart Lock users) + REASON_FAST_PERIODIC = 4; + // Expired state (e.g. expired credentials, or cached entries) was detected + REASON_EXPIRATION = 5; + // An unexpected protocol failure occurred (so attempting to repair state) + REASON_FAILURE_RECOVERY = 6; + // A new account has been added to the device + REASON_NEW_ACCOUNT = 7; + // An existing account on the device has been changed + REASON_CHANGED_ACCOUNT = 8; + // The user toggled the state of a feature (e.g. Smart Lock enabled via BT) + REASON_FEATURE_TOGGLED = 9; + // A "push" from the server caused this action (e.g. a sync tickle) + REASON_SERVER_INITIATED = 10; + // A local address change triggered this (e.g. GCM registration id changed) + REASON_ADDRESS_CHANGE = 11; + // A software update has triggered this + REASON_SOFTWARE_UPDATE = 12; + // A manual action by the user triggered this (e.g. commands sent via adb) + REASON_MANUAL = 13; + // A custom key has been invalidated on the device (e.g. screen lock is + // disabled). + REASON_CUSTOM_KEY_INVALIDATION = 14; + // Periodic action triggered by auth_proximity + REASON_PROXIMITY_PERIODIC = 15; +} + +enum Type { + ENROLLMENT = 0; + TICKLE = 1; + TX_REQUEST = 2; + TX_REPLY = 3; + TX_SYNC_REQUEST = 4; + TX_SYNC_RESPONSE = 5; + TX_PING = 6; + DEVICE_INFO_UPDATE = 7; + TX_CANCEL_REQUEST = 8; + + // DEPRECATED (can be re-used after Aug 2015) + PROXIMITYAUTH_PAIRING = 10; + + // The kind of identity assertion generated by a "GCM V1" device (i.e., + // an Android phone that has registered with us a public and a symmetric + // key) + GCMV1_IDENTITY_ASSERTION = 11; + + // Device-to-device communications are protected by an unauthenticated + // Diffie-Hellman exchange. The InitiatorHello message is simply the + // initiator's public DH key, and is not encoded as a SecureMessage, so + // it doesn't have a tag. + // The ResponderHello message (which is sent by the responder + // to the initiator), on the other hand, carries a payload that is protected + // by the derived shared key. It also contains the responder's + // public DH key. ResponderHelloAndPayload messages have the + // DEVICE_TO_DEVICE_RESPONDER_HELLO tag. + DEVICE_TO_DEVICE_RESPONDER_HELLO_PAYLOAD = 12; + + // Device-to-device communications are protected by an unauthenticated + // Diffie-Hellman exchange. Once the initiator and responder + // agree on a shared key (through Diffie-Hellman), they will use messages + // tagged with DEVICE_TO_DEVICE_MESSAGE to exchange data. + DEVICE_TO_DEVICE_MESSAGE = 13; + + // Notification to let a device know it should contact a nearby device. + DEVICE_PROXIMITY_CALLBACK = 14; + + // Device-to-device communications are protected by an unauthenticated + // Diffie-Hellman exchange. During device-to-device authentication, the first + // message from initiator (the challenge) is signed and put into the payload + // of the message sent back to the initiator. + UNLOCK_KEY_SIGNED_CHALLENGE = 15; + + // Specialty (corp only) features + LOGIN_NOTIFICATION = 101; +} + +message GcmMetadata { + required Type type = 1; + optional int32 version = 2 [default = 0]; +} + +message Tickle { + // Time after which this tickle should expire + optional fixed64 expiry_time = 1; +} + +message LoginNotificationInfo { + // Time at which the server received the login notification request. + optional fixed64 creation_time = 2; + + // Must correspond to user_id in LoginNotificationRequest, if set. + optional string email = 3; + + // Host where the user's credentials were used to login, if meaningful. + optional string host = 4; + + // Location from where the user's credentials were used, if meaningful. + optional string source = 5; + + // Type of login, e.g. ssh, gnome-screensaver, or web. + optional string event_type = 6; +} diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/securemessage.proto b/airsync-mac/Core/QuickShare/ProtobufSource/securemessage.proto new file mode 100644 index 00000000..5118d357 --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/securemessage.proto @@ -0,0 +1,126 @@ +// Copyright 2020 Google LLC +// +// Licensed 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 +// +// https://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. + +// Proto definitions for SecureMessage format + +syntax = "proto2"; + +package securemessage; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.security.cryptauth.lib.securemessage"; +option java_outer_classname = "SecureMessageProto"; +option objc_class_prefix = "SMSG"; + +message SecureMessage { + // Must contain a HeaderAndBody message + required bytes header_and_body = 1; + // Signature of header_and_body + required bytes signature = 2; +} + +// Supported "signature" schemes (both symmetric key and public key based) +enum SigScheme { + HMAC_SHA256 = 1; + ECDSA_P256_SHA256 = 2; + // Not recommended -- use ECDSA_P256_SHA256 instead + RSA2048_SHA256 = 3; +} + +// Supported encryption schemes +enum EncScheme { + // No encryption + NONE = 1; + AES_256_CBC = 2; +} + +message Header { + required SigScheme signature_scheme = 1; + required EncScheme encryption_scheme = 2; + // Identifies the verification key + optional bytes verification_key_id = 3; + // Identifies the decryption key + optional bytes decryption_key_id = 4; + // Encryption may use an IV + optional bytes iv = 5; + // Arbitrary per-protocol public data, to be sent with the plain-text header + optional bytes public_metadata = 6; + // The length of some associated data this is not sent in this SecureMessage, + // but which will be bound to the signature. + optional uint32 associated_data_length = 7 [default = 0]; +} + +message HeaderAndBody { + // Public data about this message (to be bound in the signature) + required Header header = 1; + // Payload data + required bytes body = 2; +} + +// Must be kept wire-format compatible with HeaderAndBody. Provides the +// SecureMessage code with a consistent wire-format representation that +// remains stable irrespective of protobuf implementation choices. This +// low-level representation of a HeaderAndBody should not be used by +// any code outside of the SecureMessage library implementation/tests. +message HeaderAndBodyInternal { + // A raw (wire-format) byte encoding of a Header, suitable for hashing + required bytes header = 1; + // Payload data + required bytes body = 2; +} + +// ------- +// The remainder of the messages defined here are provided only for +// convenience. They are not needed for SecureMessage proper, but are +// commonly useful wherever SecureMessage might be applied. +// ------- + +// A list of supported public key types +enum PublicKeyType { + EC_P256 = 1; + RSA2048 = 2; + // 2048-bit MODP group 14, from RFC 3526 + DH2048_MODP = 3; +} + +// A convenience proto for encoding NIST P-256 elliptic curve public keys +message EcP256PublicKey { + // x and y are encoded in big-endian two's complement (slightly wasteful) + // Client MUST verify (x,y) is a valid point on NIST P256 + required bytes x = 1; + required bytes y = 2; +} + +// A convenience proto for encoding RSA public keys with small exponents +message SimpleRsaPublicKey { + // Encoded in big-endian two's complement + required bytes n = 1; + optional int32 e = 2 [default = 65537]; +} + +// A convenience proto for encoding Diffie-Hellman public keys, +// for use only when Elliptic Curve based key exchanges are not possible. +// (Note that the group parameters must be specified separately) +message DhPublicKey { + // Big-endian two's complement encoded group element + required bytes y = 1; +} + +message GenericPublicKey { + required PublicKeyType type = 1; + optional EcP256PublicKey ec_p256_public_key = 2; + optional SimpleRsaPublicKey rsa2048_public_key = 3; + // Use only as a last resort + optional DhPublicKey dh2048_public_key = 4; +} diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/sharing_enums.proto b/airsync-mac/Core/QuickShare/ProtobufSource/sharing_enums.proto new file mode 100644 index 00000000..e0e227c3 --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/sharing_enums.proto @@ -0,0 +1,962 @@ +// Copyright 2020 Google LLC +// +// Licensed 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 +// +// https://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. + +syntax = "proto2"; + +package location.nearby.proto.sharing; + +// import "logs/proto/logs_annotations/logs_annotations.proto"; +// import "logs/proto/wireless/beto/beto_enums.proto"; +// import "logs/proto/wireless/beto/log_dimension_annotations.proto"; + +// option (logs_proto.file_not_used_for_logging_except_enums) = true; +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.location.nearby.proto"; +option java_outer_classname = "SharingEnums"; +option objc_class_prefix = "GNSHP"; + +// We use event based logging (an event object can be constructed and logged +// immediately when they occur). To obtain session based information (e.g. +// durations, counting incoming introductions), we use flowId (sender/receiver) +// in NearbyClearcutLogger (for android, or clearcut_event_logger as the +// equivalence for Windows) for all events (may exclude settings), and +// session_id for a pair of events (start and end of a session). +// Next id: 74 +enum EventType { + UNKNOWN_EVENT_TYPE = 0; + + // LINT.IfChange(EventType) + + // When new users accept agreements (like grant permission to contacts for + // CONTACT_ONLY visibility) and are enrolled into Nearby Sharing. This event + // is used to count number of new users. + ACCEPT_AGREEMENTS = 1; + + // User enables/disables nearby sharing from setting or tile service. + ENABLE_NEARBY_SHARING = 2; + + // User sets visibility preference from setting. + SET_VISIBILITY = 3; + + // Describe attachments immediately when Nearby Sharing is opened by another + // app which is used to generate/attach attachments to be shared with other + // devices. + DESCRIBE_ATTACHMENTS = 4 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Start of a scanning phase at sender. + SCAN_FOR_SHARE_TARGETS_START = 5 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_DISCOVER_START )*/ + /*]]*/; + + // End of the scanning phase at sender. + SCAN_FOR_SHARE_TARGETS_END = 6 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_DISCOVER_END )*/ + /*]]*/; + + // Receiver advertises itself for presence (a pseudo session). + ADVERTISE_DEVICE_PRESENCE_START = 7 /*[[*/ + /*( device_role = DEVICE_ROLE_REMOTE, )*/ + /*( stage = STAGE_QS_ADVERTISE_START )*/ + /*]]*/; + + // End of the advertising phase at receiver. + ADVERTISE_DEVICE_PRESENCE_END = 8 /*[[*/ + /*( device_role = DEVICE_ROLE_REMOTE, )*/ + /*( stage = STAGE_QS_ADVERTISE_END )*/ + /*]]*/; + + // Sender sends a fast initialization to receiver. + SEND_FAST_INITIALIZATION = 9 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Receiver receives the fast initialization. + RECEIVE_FAST_INITIALIZATION = 10 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Sender discovers a share target. + DISCOVER_SHARE_TARGET = 11 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_DISCOVERED )*/ + /*]]*/; + + // Sender sends introduction (before attachments being sent). + SEND_INTRODUCTION = 12 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Receiver receives introduction. + RECEIVE_INTRODUCTION = 13 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Receiver responds to introduction (before attachments being sent). + // Actions: Accept, Reject, or (for some reason) Fail. + RESPOND_TO_INTRODUCTION = 14 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Start of the sending attachments phase at sender. + SEND_ATTACHMENTS_START = 15 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_TRANSFER_START )*/ + /*]]*/; + + // End of sending attachments phase at sender. + SEND_ATTACHMENTS_END = 16 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_TRANSFER_END )*/ + /*]]*/; + + // Start of the receiving attachments phase at receiver. + RECEIVE_ATTACHMENTS_START = 17 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // End of receiving attachments phase at receiver. + RECEIVE_ATTACHMENTS_END = 18 /*[[*/ + /*( device_role = DEVICE_ROLE_REMOTE, )*/ + /*( stage = STAGE_QS_TRANSFER_END )*/ + /*]]*/; + + // Sender cancels sending attachments. + CANCEL_SENDING_ATTACHMENTS = 19 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Receiver cancels receiving attachments. + CANCEL_RECEIVING_ATTACHMENTS = 20 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Receiver opens received attachments. + OPEN_RECEIVED_ATTACHMENTS = 21 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // User opens the setup activity. + LAUNCH_SETUP_ACTIVITY = 22 [deprecated = true]; + + // User adds a contact. + ADD_CONTACT = 23; + + // User removes a contact. + REMOVE_CONTACT = 24; + + // Local devices all Fast Share server. + FAST_SHARE_SERVER_RESPONSE = 25; + + // The start of a sending session. + SEND_START = 26 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_CONNECT_START )*/ + /*]]*/; + + // Receiver accepts a fast initialization. + ACCEPT_FAST_INITIALIZATION = 27 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Set data usage preference. + SET_DATA_USAGE = 28; + + // Receiver dismisses a fast initialization + DISMISS_FAST_INITIALIZATION = 29 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Cancel connection. + CANCEL_CONNECTION = 30 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // User starts a chimera activity (e.g. ConsentsChimeraActivity, + // DeviceVisibilityChimeraActivity...) + LAUNCH_ACTIVITY = 31; + + // Receiver dismisses a privacy notification. + DISMISS_PRIVACY_NOTIFICATION = 32; + + // Receiver taps a privacy notification. + TAP_PRIVACY_NOTIFICATION = 33; + + // Receiver taps a help page. + TAP_HELP = 34; + + // Receiver taps a feedback. + TAP_FEEDBACK = 35; + + // Receiver adds quick settings tile. + ADD_QUICK_SETTINGS_TILE = 36; + + // Receiver removes quick settings tile. + REMOVE_QUICK_SETTINGS_TILE = 37; + + // Receiver phone consent clicked. + LAUNCH_PHONE_CONSENT = 38; + + // Devices show a phone consent banner in Nearby Share Settings + DISPLAY_PHONE_CONSENT = 54; + + // Receiver taps quick settings tile. + TAP_QUICK_SETTINGS_TILE = 39; + + // Receiver Installation of APKs status. + INSTALL_APK = 40 /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Receiver verification of APKs status. + VERIFY_APK = 41 /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // User starts a consent. + LAUNCH_CONSENT = 42; + + // After receiving payloads, Nearby Share still needs to transfer the payloads + // to correct attachment formats and move files attachments from temporary + // directory to final destination. + PROCESS_RECEIVED_ATTACHMENTS_END = 43 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Toggle Show Notification setting item in Nearby Share setting. + TOGGLE_SHOW_NOTIFICATION = 44; + + // Set device name + SET_DEVICE_NAME = 45; + + // users dropped off opt-in page. + DECLINE_AGREEMENTS = 46; + + // Request setting permissions (Wifi/BT/location/airplane mode). + REQUEST_SETTING_PERMISSIONS = 47; + + // Set up a connection with the remote device. + ESTABLISH_CONNECTION = 48 /*[ stage = STAGE_QS_CONNECT_END ]*/; + + // Track device states in Nearby Share setting. + DEVICE_SETTINGS = 49; + + // Receiver auto dismisses a fast initialization notification. + AUTO_DISMISS_FAST_INITIALIZATION = 50 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // App Crash event. + // Used only for Windows App now. + APP_CRASH = 51; + + // Sender taps the Send button in quick settings + TAP_QUICK_SETTINGS_FILE_SHARE = 52 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Devices show a privacy notification + DISPLAY_PRIVACY_NOTIFICATION = 53; + + // Preference usage event (e.g. load/save preferences, etc). + // Used only for Windows App now. + PREFERENCES_USAGE = 55; + + // Default opt in + DEFAULT_OPT_IN = 56; + + // The result of the setup wizard flow + SETUP_WIZARD = 57; + + // Sender taps a QR code + TAP_QR_CODE = 58 /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // QR code link shown + QR_CODE_LINK_SHOWN = 59 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Sender failed to parse endpoint id. + PARSING_FAILED_ENDPOINT_ID = 60 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // The device is discovered by fast initialization + FAST_INIT_DISCOVER_DEVICE = 61 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Send desktop notification. + SEND_DESKTOP_NOTIFICATION = 62; + + // User sets account preference + SET_ACCOUNT = 63; + + // Decrypt certificate failure + DECRYPT_CERTIFICATE_FAILURE = 64; + + // Show allow permission auto access UI + SHOW_ALLOW_PERMISSION_AUTO_ACCESS = 65 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // UI events for transferring files with desktop applications. It includes + // event types such as DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE. + SEND_DESKTOP_TRANSFER_EVENT = 66; + + // Show accept button on Quick Share receive UI + WAITING_FOR_ACCEPT = 67; + + // High quality event setup + HIGH_QUALITY_MEDIUM_SETUP = 68; + + // RPC call status + RPC_CALL_STATUS = 69; + + // A QR code sharing session has started + START_QR_CODE_SESSION = 70; + + // A QR code URL has been opened in a web client/browser instead of in a + // native Quick Share app. + QR_CODE_OPENED_IN_WEB_CLIENT = 71; + + // A HaTS survey session id has been joined with Quick Share flow id. + HATS_JOINT_EVENT = 72; + + // Previews received. + RECEIVE_PREVIEWS = 73; + + // LINT.ThenChange(//depot/google3/location/nearby/proto/nearby_event_codes.proto:SharingEventCode) +} + +// Event category to differentiate whether this comes from sender or receiver, +// whether this is for communication flow, or for settings. +enum EventCategory { + UNKNOWN_EVENT_CATEGORY = 0; + SENDING_EVENT = 1; + RECEIVING_EVENT = 2; + SETTINGS_EVENT = 3; + RPC_EVENT = 4; +} + +// Status of nearby sharing. +enum NearbySharingStatus { + UNKNOWN_NEARBY_SHARING_STATUS = 0; + + ON = 1; + OFF = 2; +} + +enum Visibility { + UNKNOWN_VISIBILITY = 0; + + CONTACTS_ONLY = 1; + EVERYONE = 2; + SELECTED_CONTACTS_ONLY = 3 [deprecated = true]; + HIDDEN = 4; + SELF_SHARE = 5; +} + +enum DataUsage { + UNKNOWN_DATA_USAGE = 0; + + ONLINE = 1; + WIFI_ONLY = 2; + OFFLINE = 3; +} + +// The status of establishing a connection. Used by ESTABLISH_CONNECTION. +enum EstablishConnectionStatus { + CONNECTION_STATUS_UNKNOWN = 0; + + CONNECTION_STATUS_SUCCESS = 1 + /*[ status_bucket = STATUS_SUCCESSFUL ]*/; + CONNECTION_STATUS_FAILURE = 2 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_CANCELLATION = 3 + /*[ status_bucket = STATUS_CANCELLED ]*/; + CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT = 4 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE = 5 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION = 6 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_NULL_CONNECTION = 7 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_LOST_CONNECTIVITY = 9 + /*[ status_bucket = STATUS_INTERRUPTION ]*/; + // TODO: b/341782941 - : Annote this status when it's confirmed by Nearby + // Connections team. + CONNECTION_STATUS_INVALID_ADVERTISEMENT = 10; +} + +// The status of sending and receiving attachments. Used by SEND_ATTACHMENTS. +enum AttachmentTransmissionStatus { + UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS = 0; + COMPLETE_ATTACHMENT_TRANSMISSION_STATUS = 1 + /*[ status_bucket = STATUS_SUCCESSFUL ]*/; + CANCELED_ATTACHMENT_TRANSMISSION_STATUS = 2 + /*[ status_bucket = STATUS_CANCELLED ]*/; + FAILED_ATTACHMENT_TRANSMISSION_STATUS = 3 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + REJECTED_ATTACHMENT = 4 [deprecated = true]; + TIMED_OUT_ATTACHMENT = 5 [deprecated = true]; + AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT = 6 [deprecated = true]; + NOT_ENOUGH_SPACE_ATTACHMENT = 7 [deprecated = true]; + FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8 [deprecated = true]; + MEDIA_UNAVAILABLE_ATTACHMENT = 9 [deprecated = true]; + UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT = 10 [deprecated = true]; + NO_ATTACHMENT_FOUND = 11 [deprecated = true]; + FAILED_NO_SHARE_TARGET_ENDPOINT = 12 [deprecated = true]; + FAILED_PAIRED_KEYHANDSHAKE = 13 [deprecated = true]; + FAILED_NULL_CONNECTION = 14 [deprecated = true]; + FAILED_NO_PAYLOAD = 15 [deprecated = true]; + FAILED_WRITE_INTRODUCTION = 16 [deprecated = true]; + + // The remote response is either missing or has an unknown type. + FAILED_UNKNOWN_REMOTE_RESPONSE = 17 [deprecated = true]; + + // Breakdowns of FAILED_NULL_CONNECTION (Desktop side) + FAILED_NULL_CONNECTION_INIT_OUTGOING = 18; + FAILED_NULL_CONNECTION_DISCONNECTED = 19; + + // Breakdowns of FAILED_NULL_CONNECTION (android side) + // Connection failed due to Wifi is disconnected or Bluetooth setting is off + // or user turn on airplane mode. + FAILED_NULL_CONNECTION_LOST_CONNECTIVITY = 20 [deprecated = true]; + // Unexpected connection failure. + FAILED_NULL_CONNECTION_FAILURE = 21 [deprecated = true]; + + REJECTED_ATTACHMENT_TRANSMISSION_STATUS = 22; + TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS = 23; + NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS = 24 + /*[ status_bucket = STATUS_INTERRUPTION ]*/; + UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS = 25; + FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS = 26; + // Connection failed due to Wifi is disconnected or Bluetooth setting is off + // or user turn on airplane mode. + NO_RESPONSE_FRAME_CONNECTION_CLOSED_LOST_CONNECTIVITY_TRANSMISSION_STATUS = 27 + [deprecated = true]; + // Unexpected connection failure due to no response frame. + NO_RESPONSE_FRAME_CONNECTION_CLOSED_TRANSMISSION_STATUS = 28; + // Connection failed due to Wifi is disconnected or Bluetooth setting is off + // or user turn on airplane mode. + LOST_CONNECTIVITY_TRANSMISSION_STATUS = 29 + /*[ status_bucket = STATUS_INTERRUPTION ]*/; + // Connection failed due to the medium is not allowed. + FAILED_DISALLOWED_MEDIUM = 30; +} + +// Generic result status of NearbyConnections API calls. +enum ConnectionLayerStatus { + // No status is available + CONNECTION_LAYER_STATUS_UNKNOWN = 0; + // The operation was successful. + CONNECTION_LAYER_STATUS_SUCCESS = 1; + // The operation failed, without any more information. + CONNECTION_LAYER_STATUS_ERROR = 2; + // The app called an API method out of order (i.e. another method is expected + // to be called first). + CONNECTION_LAYER_STATUS_OUT_OF_ORDER_API_CALL = 3; + // The app already has active operations (advertising, discovering, or + // connected to other devices) with another Strategy. Stop these operations on + // the current Strategy before trying to advertise or discover with a new + // Strategy. + CONNECTION_LAYER_STATUS_ALREADY_HAVE_ACTIVE_STRATEGY = 4; + // The app is already advertising; call StopAdvertising() before trying to + // advertise again. + CONNECTION_LAYER_STATUS_ALREADY_ADVERTISING = 5; + // The app is already discovering; call StopDiscovery() before trying to + // discover again. + CONNECTION_LAYER_STATUS_ALREADY_DISCOVERING = 6; + // NC is already listening for incoming connections from remote endpoints. + CONNECTION_LAYER_STATUS_ALREADY_LISTENING = 7; + // An attempt to read from/write to a connected remote endpoint failed. If + // this occurs repeatedly, consider invoking DisconnectFromEndpoint(). + CONNECTION_LAYER_STATUS_END_POINT_IO_ERROR = 8; + // An attempt to interact with a remote endpoint failed because it's unknown + // to us -- it's either an endpoint that was never discovered, or an endpoint + // that never connected to us (both of which are indicative of bad input from + // the client app). + CONNECTION_LAYER_STATUS_END_POINT_UNKNOWN = 9; + // The remote endpoint rejected the connection request. + CONNECTION_LAYER_STATUS_CONNECTION_REJECTED = 10; + // The app is already connected to the specified endpoint. Multiple + // connections to a remote endpoint cannot be maintained simultaneously. + CONNECTION_LAYER_STATUS_ALREADY_CONNECTED_TO_END_POINT = 11; + // The remote endpoint is not connected; messages cannot be sent to it. + CONNECTION_LAYER_STATUS_NOT_CONNECTED_TO_END_POINT = 12; + // There was an error trying to use the device's Bluetooth capabilities. + CONNECTION_LAYER_STATUS_BLUETOOTH_ERROR = 13; + // There was an error trying to use the device's Bluetooth Low Energy + // capabilities. + CONNECTION_LAYER_STATUS_BLE_ERROR = 14; + // There was an error trying to use the device's Wi-Fi capabilities. + CONNECTION_LAYER_STATUS_WIFI_LAN_ERROR = 15; + // An attempt to interact with an in-flight Payload failed because it's + // unknown to us. + CONNECTION_LAYER_STATUS_PAYLOAD_UNKNOWN = 16; + // The connection was reset + CONNECTION_LAYER_STATUS_RESET = 17; + // The connection timed out + CONNECTION_LAYER_STATUS_TIMEOUT = 18; +} + +// The status of processing attachments after receiver received payloads +// successfully. +enum ProcessReceivedAttachmentsStatus { + PROCESSING_STATUS_UNKNOWN = 0; + + PROCESSING_STATUS_COMPLETE_PROCESSING_ATTACHMENTS = 1; + PROCESSING_STATUS_FAILED_MOVING_FILES = 2; + PROCESSING_STATUS_FAILED_RECEIVING_APK = 3; + PROCESSING_STATUS_FAILED_RECEIVING_TEXT = 4; + PROCESSING_STATUS_FAILED_RECEIVING_WIFI_CREDENTIALS = 5; +} + +// The status of advertising and discovering sessions. Used by +// SCAN_FOR_SHARE_TARGETS and ADVERTISE_DEVICE_PRESENCE. +enum SessionStatus { + UNKNOWN_SESSION_STATUS = 0; + SUCCEEDED_SESSION_STATUS = 1 + /*[ status_bucket = STATUS_SUCCESSFUL ]*/; + + // TODO: b/341782941 - FAILED_SESSION_STATUS occurs when the status of + // advertising or discovering sessions is not successful. It can be + // due to STATUS_INTERNAL_ERROR, STATUS_INTERRUPTION, STATUS_CANCELLED. + // More session statuses should be logged to determine the status. + FAILED_SESSION_STATUS = 2; +} + +// User's response to introductions. +enum ResponseToIntroduction { + UNKNOWN_RESPONSE_TO_INTRODUCTION = 0; + + ACCEPT_INTRODUCTION = 1; + REJECT_INTRODUCTION = 2; + FAIL_INTRODUCTION = 3; +} + +// TODO(fdi): may eventually include desktop, etc. +// The type of a remote device. +enum DeviceType { + UNKNOWN_DEVICE_TYPE = 0; + + PHONE = 1; + TABLET = 2; + LAPTOP = 3; + CAR = 4; + FOLDABLE = 5; + XR = 6; +} + +// TODO(fdi): may eventually include windows, iOS, etc. +// The OS type of a remote device. +enum OSType { + UNKNOWN_OS_TYPE = 0; + + ANDROID = 1; + CHROME_OS = 2; + IOS = 3; + WINDOWS = 4; + MACOS = 5; +} + +// Relationship of remote device to sender device. +enum DeviceRelationship { + UNKNOWN_DEVICE_RELATIONSHIP = 0; + + // The remote device belongs to the same owner as sender device. + IS_SELF = 1; + // The remote device is a contact of sender. + IS_CONTACT = 2; + // The remote device is a stranger. + IS_STRANGER = 3; +} + +// The device sources of the clearcut log. +enum LogSource { + UNSPECIFIED_SOURCE = 0; + + // Represents the devices in Nearby labs. + LAB_DEVICES = 1; + // Represents the devices tested by Nearby engs, in the long term can include + // any devices with newest feature flags. + INTERNAL_DEVICES = 2; + // Represents the devices testing our in-development features before they're + // released to the greater public. + BETA_TESTER_DEVICES = 3; + // Represents the OEM partners (like Samsung) that we're working with to + // verify functionality on their devices. + OEM_DEVICES = 4; + // Represents the device for debugging. + DEBUG_DEVICES = 5; + // Represents the device for Nearby Module Food. + NEARBY_MODULE_FOOD_DEVICES = 6; + // Represents the device for BeTo Team Food. + BETO_DOGFOOD_DEVICES = 7; + // Represents the device for Nearby dog Food. + NEARBY_DOGFOOD_DEVICES = 8; + // Represents the device for Nearby Team Food. + NEARBY_TEAMFOOD_DEVICES = 9; +} + +// The Fast Share server action name. +enum ServerActionName { + UNKNOWN_SERVER_ACTION = 0; + + UPLOAD_CERTIFICATES = 1; + DOWNLOAD_CERTIFICATES = 2; + CHECK_REACHABILITY = 3; + UPLOAD_CONTACTS = 4; + UPDATE_DEVICE_NAME = 5; + UPLOAD_SENDER_CERTIFICATES = 6; + DOWNLOAD_SENDER_CERTIFICATES = 7; + UPLOAD_CONTACTS_AND_CERTIFICATES = 8; + LIST_REACHABLE_PHONE_NUMBERS = 9; + LIST_MY_DEVICES = 10; + LIST_CONTACT_PEOPLE = 11; + + // used for analytics logger to record action name. + DOWNLOAD_CERTIFICATES_INFO = 12; +} + +// The Fast Share server response state. +enum ServerResponseState { + UNKNOWN_SERVER_RESPONSE_STATE = 0; + + SERVER_RESPONSE_SUCCESS = 1; + SERVER_RESPONSE_UNKNOWN_FAILURE = 2; + + // For StatusException. + SERVER_RESPONSE_STATUS_OTHER_FAILURE = 3; + SERVER_RESPONSE_STATUS_DEADLINE_EXCEEDED = 4; + SERVER_RESPONSE_STATUS_PERMISSION_DENIED = 5; + SERVER_RESPONSE_STATUS_UNAVAILABLE = 6; + SERVER_RESPONSE_STATUS_UNAUTHENTICATED = 7; + SERVER_RESPONSE_STATUS_INVALID_ARGUMENT = 9; + + // For GoogleAuthException. + SERVER_RESPONSE_GOOGLE_AUTH_FAILURE = 8; + + // For Internet connect status. + SERVER_RESPONSE_NOT_CONNECTED_TO_INTERNET = 10; +} + +// The purpose of requesting the server request. +enum SyncPurpose { + SYNC_PURPOSE_UNKNOWN = 0; + // When NearbySharingChimeraService#sync() is called. + SYNC_PURPOSE_ON_DEMAND_SYNC = 1; + // Requested by chime notification. + SYNC_PURPOSE_CHIME_NOTIFICATION = 2; + // For reqular daily sync. + SYNC_PURPOSE_DAILY_SYNC = 3; + // Wen a device opts into Nearby Share. + SYNC_PURPOSE_OPT_IN_FIRST_SYNC = 4; + // Requested when Nearby Share automatically enables a device that shares + // a single account that has already opted in on another device. + SYNC_PURPOSE_CHECK_DEFAULT_OPT_IN = 5; + // When a device enables Nearby Share. + SYNC_PURPOSE_NEARBY_SHARE_ENABLED = 6; + // When a device is in fast init advertising. + SYNC_PURPOSE_SYNC_AT_FAST_INIT = 7; + // When device start discovery. + SYNC_PURPOSE_SYNC_AT_DISCOVERY = 8; + // When device tries to load valid private certificate. + SYNC_PURPOSE_SYNC_AT_LOAD_PRIVATE_CERTIFICATE = 9; + // When device start advertiseement. + SYNC_PURPOSE_SYNC_AT_ADVERTISEMENT = 10; + // When device contacts list changes. + SYNC_PURPOSE_CONTACT_LIST_CHANGE = 11; + // When showing the C11 banner in Neary Share setting. + SYNC_PURPOSE_SHOW_C11N_VIEW = 12; + // For regular check contact reachability. + SYNC_PURPOSE_REGULAR_CHECK_CONTACT_REACHABILITY = 13; + // When selected contacts list changes in visibility setting. + SYNC_PURPOSE_VISIBILITY_SELECTED_CONTACT_CHANGE = 14; + // When switching account. + SYNC_PURPOSE_ACCOUNT_CHANGE = 15; + // When regenerate certificates + SYNC_PURPOSE_REGENERATE_CERTIFICATES = 16; + // When Device Contacts consent changes + SYNC_PURPOSE_DEVICE_CONTACTS_CONSENT_CHANGE = 17; +} + +// The device role to trigger the server request. +enum ClientRole { + CLIENT_ROLE_UNKNOWN = 0; + CLIENT_ROLE_SENDER = 1; + CLIENT_ROLE_RECEIVER = 2; +} + +// The type of Nearby Sharing scanning. +enum ScanType { + UNKNOWN_SCAN_TYPE = 0; + FOREGROUND_SCAN = 1; + FOREGROUND_RETRY_SCAN = 2; + DIRECT_SHARE_SCAN = 3; + BACKGROUND_SCAN = 4; +} + +// The type of parsing endpoint id failed type. +enum ParsingFailedType { + FAILED_UNKNOWN_TYPE = 0; + // NULL advertisement is returned due to sender failing to parse advertisement + // from endpointInfo byte stream from receiver advertisement. + FAILED_PARSE_ADVERTISEMENT = 1; + // NULL shareTarget is returned due to sender failing to create shareTarget + // from a valid parsed advertisement stemming from issues in certificates, QR + // code tokens or device names. + FAILED_CONVERT_SHARE_TARGET = 2; +} + +// The Nearby Sharing advertising mode. +enum AdvertisingMode { + UNKNOWN_ADVERTISING_MODE = 0; + SCREEN_OFF_ADVERTISING_MODE = 1; + BACKGROUND_ADVERTISING_MODE = 2; + MIDGROUND_ADVERTISING_MODE = 3; + FOREGROUND_ADVERTISING_MODE = 4; + SUSPENDED_ADVERTISING_MODE = 5; +} + +// The Nearby Sharing discovery mode. +enum DiscoveryMode { + UNKNOWN_DISCOVERY_MODE = 0; + SCREEN_OFF_DISCOVERY_MODE = 1; + BACKGROUND_DISCOVERY_MODE = 2; + MIDGROUND_DISCOVERY_MODE = 3; + FOREGROUND_DISCOVERY_MODE = 4; + SUSPENDED_DISCOVERY_MODE = 5; +} + +// The class name of chimera activity. +enum ActivityName { + UNKNOWN_ACTIVITY = 0; + + SHARE_SHEET_ACTIVITY = 1; + SETTINGS_ACTIVITY = 2; + RECEIVE_SURFACE_ACTIVITY = 3; + SETUP_ACTIVITY = 4; + DEVICE_VISIBILITY_ACTIVITY = 5; + CONSENTS_ACTIVITY = 6; + SET_DEVICE_NAME_DIALOG = 7; + SET_DATA_USAGE_DIALOG = 8; + QUICK_SETTINGS_ACTIVITY = 9; + REMOTE_COPY_SHARE_SHEET_ACTIVITY = 10; + SETUP_WIZARD_ACTIVITY = 11; + SETTINGS_REVIEW_ACTIVITY = 12; +} + +// The type of consent page user launches. +enum ConsentType { + CONSENT_TYPE_UNKNOWN = 0; + + // launch Constellation consent page. + CONSENT_TYPE_C11N = 1; + // launch device contact consent page. + CONSENT_TYPE_DEVICE_CONTACT = 2; +} + +enum ConsentAcceptanceStatus { + CONSENT_UNKNOWN_ACCEPT_STATUS = 0; + + CONSENT_ACCEPTED = 1; + CONSENT_DECLINED = 2; + // unable to enable consent. + CONSENT_UNABLE_TO_ENABLE = 3; +} + +enum ApkSource { + UNKNOWN_APK_SOURCE = 0; + + APK_FROM_SD_CARD = 1; + INSTALLED_APP = 2; +} + +// The Installation status of APK. +enum InstallAPKStatus { + UNKNOWN_INSTALL_APK_STATUS = 0; + + FAIL_INSTALLATION = 1; + SUCCESS_INSTALLATION = 2; +} + +// The verification status of APK. +enum VerifyAPKStatus { + UNKNOWN_VERIFY_APK_STATUS = 0; + + NOT_INSTALLABLE = 1; + INSTALLABLE = 2; + ALREADY_INSTALLED = 3; +} + +enum ShowNotificationStatus { + UNKNOWN_SHOW_NOTIFICATION_STATUS = 0; + + SHOW = 1; + NOT_SHOW = 2; +} + +enum PermissionRequestResult { + PERMISSION_UNKNOWN_REQUEST_RESULT = 0; + + PERMISSION_GRANTED = 1; + PERMISSION_REJECTED = 2; + PERMISSION_UNABLE_TO_GRANT = 3; +} + +enum PermissionRequestType { + PERMISSION_UNKNOWN_TYPE = 0; + + PERMISSION_AIRPLANE_MODE_OFF = 1; + PERMISSION_WIFI = 2; + PERMISSION_BLUETOOTH = 3; + PERMISSION_LOCATION = 4; + PERMISSION_WIFI_HOTSPOT = 5; +} + +enum SharingUseCase { + USE_CASE_UNKNOWN = 0; + + USE_CASE_NEARBY_SHARE = 1; + USE_CASE_REMOTE_COPY_PASTE = 2; + USE_CASE_WIFI_CREDENTIAL = 3; + USE_CASE_APP_SHARE = 4; + USE_CASE_QUICK_SETTING_FILE_SHARE = 5; + USE_CASE_SETUP_WIZARD = 6; + // Deprecated. QR code is an addition to existing use cases rather than being + // a separate use case. + USE_CASE_NEARBY_SHARE_WITH_QR_CODE = 7 [deprecated = true]; + // The user was redirected from Bluetooth sharing UI to Nearby Share + USE_CASE_REDIRECTED_FROM_BLUETOOTH_SHARE = 8; +} + +// Used only for Windows App now. +enum AppCrashReason { + APP_CRASH_REASON_UNKNOWN = 0; +} + +// Thes source where the attachemnt comes from. It can be an action, app name, +// etc. The first 6 source types are being used as FileSenderType in Nearby +// Share Windows app. +enum AttachmentSourceType { + ATTACHMENT_SOURCE_UNKNOWN = 0; + ATTACHMENT_SOURCE_CONTEXT_MENU = 1; + ATTACHMENT_SOURCE_DRAG_AND_DROP = 2; + ATTACHMENT_SOURCE_SELECT_FILES_BUTTON = 3; + ATTACHMENT_SOURCE_PASTE = 4; + ATTACHMENT_SOURCE_SELECT_FOLDERS_BUTTON = 5; + ATTACHMENT_SOURCE_SHARE_ACTIVATION = 6; +} + +// The action to interact with preferences. +// Used only for Windows App now. +enum PreferencesAction { + PREFERENCES_ACTION_UNKNOWN = 0; + PREFERENCES_ACTION_NO_ACTION = 1; + + // Primary actions/functions towards preferences + PREFERENCES_ACTION_LOAD_PREFERENCES = 2; + PREFERENCES_ACTION_SAVE_PREFERENCESS = 3; + PREFERENCES_ACTION_ATTEMPT_LOAD = 4; + PREFERENCES_ACTION_RESTORE_FROM_BACKUP = 5; + + // Other actions within the 4 actions above + PREFERENCES_ACTION_CREATE_PREFERENCES_PATH = 6; + PREFERENCES_ACTION_MAKE_PREFERENCES_BACKUP_FILE = 7; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_PATH_EXISTS = 8; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_INPUT_STREAM_STATUS = 9; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_FILE_IS_CORRUPTED = 10; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_BACKUP_FILE_EXISTS = 11; +} + +// The status of the action to interact with preferences. +// Used only for Windows App now. +enum PreferencesActionStatus { + PREFERENCES_ACTION_STATUS_UNKNOWN = 0; + PREFERENCES_ACTION_STATUS_SUCCESS = 1; + PREFERENCES_ACTION_STATUS_FAIL = 2; +} + +/** The distance of the found nearby fast init advertisement. */ +enum FastInitState { + FAST_INIT_UNKNOWN_STATE = 0; + // A device was found in close proximity. + // distance < fast_init_distance_close_centimeters(50 cm) + FAST_INIT_CLOSE_STATE = 1; + // A device was found in far proximity. + // distance < fast_init_distance_close_centimeters(10 m) + FAST_INIT_FAR_STATE = 2; + // No devices have been found nearby. The default state. + FAST_INIT_LOST_STATE = 3; +} + +/** The type of FastInit advertisement. */ +enum FastInitType { + FAST_INIT_UNKNOWN_TYPE = 0; + // Show HUN to notify the user. + FAST_INIT_NOTIFY_TYPE = 1; + // Not notify the user. + FAST_INIT_SILENT_TYPE = 2; +} + +// LINT.IfChange +/** The type of desktop notification event. */ +enum DesktopNotification { + DESKTOP_NOTIFICATION_UNKNOWN = 0; + DESKTOP_NOTIFICATION_CONNECTING = 1; + DESKTOP_NOTIFICATION_PROGRESS = 2; + DESKTOP_NOTIFICATION_ACCEPT = 3; + DESKTOP_NOTIFICATION_RECEIVED = 4; + DESKTOP_NOTIFICATION_ERROR = 5; +} + +enum DesktopTransferEventType { + DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN = 0; + + // Receive attachments. + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ACCEPT = 1; + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_PROGRESS = 2; + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_RECEIVED = 3; + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ERROR = 4; + + // Send attachments. + DESKTOP_TRANSFER_EVENT_SEND_TYPE_START = 5; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE = 6; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_PROGRESS = 7; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_SENT = 8; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_ERROR = 9; +} + +enum DecryptCertificateFailureStatus { + DECRYPT_CERT_UNKNOWN_FAILURE = 0; + DECRYPT_CERT_NO_SUCH_ALGORITHM_FAILURE = 1; + DECRYPT_CERT_NO_SUCH_PADDING_FAILURE = 2; + DECRYPT_CERT_INVALID_KEY_FAILURE = 3; + DECRYPT_CERT_INVALID_ALGORITHM_PARAMETER_FAILURE = 4; + DECRYPT_CERT_ILLEGAL_BLOCK_SIZE_FAILURE = 5; + DECRYPT_CERT_BAD_PADDING_FAILURE = 6; +} + +// Refer to go/qs-contacts-consent-2024 for the detail. +enum ContactAccess { + CONTACT_ACCESS_UNKNOWN = 0; + + CONTACT_ACCESS_NO_CONTACT_UPLOADED = 1; + CONTACT_ACCESS_ONLY_UPLOAD_GOOGLE_CONTACT = 2; + CONTACT_ACCESS_UPLOAD_CONTACT_FOR_DEVICE_CONTACT_CONSENT = 3; + CONTACT_ACCESS_UPLOAD_CONTACT_FOR_QUICK_SHARE_CONSENT = 4; +} + +// Refer to go/qs-contacts-consent-2024 for the detail. +enum IdentityVerification { + IDENTITY_VERIFICATION_UNKNOWN = 0; + + IDENTITY_VERIFICATION_NO_PHONE_NUMBER_VERIFIED = 1; + IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_NOT_LINKED_TO_GAIA = 2; + IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_LINKED_TO_QS_GAIA = 3; +} + +enum ButtonStatus { + BUTTON_STATUS_UNKNOWN = 0; + BUTTON_STATUS_CLICK_ACCEPT = 1; + BUTTON_STATUS_CLICK_REJECT = 2; + BUTTON_STATUS_IGNORE = 3; +} +// LINT.ThenChange( +// //depot/google3/location/nearby/cpp/sharing/clients/dart/platform/lib/types/models.dart +// ) diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/ukey.proto b/airsync-mac/Core/QuickShare/ProtobufSource/ukey.proto new file mode 100644 index 00000000..327d8d3d --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/ukey.proto @@ -0,0 +1,105 @@ +// Copyright 2020 Google LLC +// +// Licensed 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 +// +// https://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. + +syntax = "proto2"; + +package securegcm; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.security.cryptauth.lib.securegcm"; +option java_outer_classname = "UkeyProto"; + +message Ukey2Message { + enum Type { + UNKNOWN_DO_NOT_USE = 0; + ALERT = 1; + CLIENT_INIT = 2; + SERVER_INIT = 3; + CLIENT_FINISH = 4; + } + + optional Type message_type = 1; // Identifies message type + optional bytes message_data = 2; // Actual message, to be parsed according to + // message_type +} + +message Ukey2Alert { + enum AlertType { + // Framing errors + BAD_MESSAGE = 1; // The message could not be deserialized + BAD_MESSAGE_TYPE = 2; // message_type has an undefined value + INCORRECT_MESSAGE = 3; // message_type received does not correspond to + // expected type at this stage of the protocol + BAD_MESSAGE_DATA = 4; // Could not deserialize message_data as per + // value inmessage_type + + // ClientInit and ServerInit errors + BAD_VERSION = 100; // version is invalid; server cannot find + // suitable version to speak with client. + BAD_RANDOM = 101; // Random data is missing or of incorrect + // length + BAD_HANDSHAKE_CIPHER = 102; // No suitable handshake ciphers were found + BAD_NEXT_PROTOCOL = 103; // The next protocol is missing, unknown, or + // unsupported + BAD_PUBLIC_KEY = 104; // The public key could not be parsed + + // Other errors + INTERNAL_ERROR = 200; // An internal error has occurred. error_message + // may contain additional details for logging + // and debugging. + } + + optional AlertType type = 1; + optional string error_message = 2; +} + +enum Ukey2HandshakeCipher { + RESERVED = 0; + P256_SHA512 = 100; // NIST P-256 used for ECDH, SHA512 used for + // commitment + CURVE25519_SHA512 = 200; // Curve 25519 used for ECDH, SHA512 used for + // commitment +} + +message Ukey2ClientInit { + optional int32 version = 1; // highest supported version for rollback + // protection + optional bytes random = 2; // random bytes for replay/reuse protection + + // One commitment (hash of ClientFinished containing public key) per supported + // cipher + message CipherCommitment { + optional Ukey2HandshakeCipher handshake_cipher = 1; + optional bytes commitment = 2; + } + repeated CipherCommitment cipher_commitments = 3; + + // Next protocol that the client wants to speak. + optional string next_protocol = 4; +} + +message Ukey2ServerInit { + optional int32 version = 1; // highest supported version for rollback + // protection + optional bytes random = 2; // random bytes for replay/reuse protection + + // Selected Cipher and corresponding public key + optional Ukey2HandshakeCipher handshake_cipher = 3; + optional bytes public_key = 4; +} + +message Ukey2ClientFinished { + optional bytes public_key = 1; // public key matching selected handshake + // cipher +} diff --git a/airsync-mac/Core/QuickShare/ProtobufSource/wire_format.proto b/airsync-mac/Core/QuickShare/ProtobufSource/wire_format.proto new file mode 100644 index 00000000..82510d30 --- /dev/null +++ b/airsync-mac/Core/QuickShare/ProtobufSource/wire_format.proto @@ -0,0 +1,408 @@ +// Copyright 2023 Google LLC +// +// Licensed 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 +// +// https://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. + +syntax = "proto2"; + +//package nearby.sharing.service.proto; +package sharing.nearby; + +// import "storage/datapol/annotations/proto/semantic_annotations.proto"; +import "sharing_enums.proto"; + +option java_package = "com.google.android.gms.nearby.sharing"; +option java_outer_classname = "Protocol"; +option objc_class_prefix = "GNSHP"; +option optimize_for = LITE_RUNTIME; + +// File metadata. Does not include the actual bytes of the file. +// NEXT_ID=10 +message FileMetadata { + enum Type { + UNKNOWN = 0; + IMAGE = 1; + VIDEO = 2; + ANDROID_APP = 3; + AUDIO = 4; + DOCUMENT = 5; + CONTACT_CARD = 6; + } + + // The human readable name of this file (eg. 'Cookbook.pdf'). + optional string name = 1; + + // The type of file (eg. 'IMAGE' from 'dog.jpg'). Specifying a type helps + // provide a richer experience on the receiving side. + optional Type type = 2 [default = UNKNOWN]; + + // The FILE payload id that will be sent as a follow up containing the actual + // bytes of the file. + optional int64 payload_id = 3; + + // The total size of the file. + optional int64 size = 4; + + // The mimeType of file (eg. 'image/jpeg' from 'dog.jpg'). Specifying a + // mimeType helps provide a richer experience on receiving side. + optional string mime_type = 5 [default = "application/octet-stream"]; + + // A uuid for the attachment. Should be unique across all attachments. + optional int64 id = 6; + + // The parent folder. + optional string parent_folder = 7; + + // A stable identifier for the attachment. Used for receiver to identify same + // attachment from different transfers. + optional int64 attachment_hash = 8; + + // True, if image in file attachment is sensitive + optional bool is_sensitive_content = 9; +} + +// NEXT_ID=8 +message TextMetadata { + enum Type { + UNKNOWN = 0; + TEXT = 1; + // Open with browsers. + URL = 2; + // Open with map apps. + ADDRESS = 3; + // Dial. + PHONE_NUMBER = 4; + } + + // The title of the text content. + optional string text_title = 2; + + // The type of text (phone number, url, address, or plain text). + optional Type type = 3 [default = UNKNOWN]; + + // The BYTE payload id that will be sent as a follow up containing the actual + // bytes of the text. + optional int64 payload_id = 4; + + // The size of the text content. + optional int64 size = 5; + + // A uuid for the attachment. Should be unique across all attachments. + optional int64 id = 6; + + // True if text is sensitive, e.g. password + optional bool is_sensitive_text = 7; +} + +// NEXT_ID=6 +message WifiCredentialsMetadata { + enum SecurityType { + UNKNOWN_SECURITY_TYPE = 0; + OPEN = 1; + WPA_PSK = 2; + WEP = 3; + SAE = 4; + } + + // The Wifi network name. This will be sent in introduction. + optional string ssid = 2; + + // The security type of network (OPEN, WPA_PSK, WEP). + optional SecurityType security_type = 3 [default = UNKNOWN_SECURITY_TYPE]; + + // The BYTE payload id that will be sent as a follow up containing the + // password. + optional int64 payload_id = 4; + + // A uuid for the attachment. Should be unique across all attachments. + optional int64 id = 5; +} + +// NEXT_ID=8 +message AppMetadata { + // The app name. This will be sent in introduction. + optional string app_name = 1; + + // The size of the all split of apks. + optional int64 size = 2; + + // The File payload id that will be sent as a follow up containing the + // apk paths. + repeated int64 payload_id = 3 [packed = true]; + + // A uuid for the attachment. Should be unique across all attachments. + optional int64 id = 4; + + // The name of apk file. This will be sent in introduction. + repeated string file_name = 5; + + // The size of apk file. This will be sent in introduction. + repeated int64 file_size = 6 [packed = true]; + + // The package name. This will be sent in introduction. + optional string package_name = 7; +} + +// NEXT_ID=5 +message StreamMetadata { + // A human readable description for the stream. + optional string description = 1; + + // The package name of the sending application. + optional string package_name = 2; + + // The payload id that will be send as a followup containing the + // ParcelFileDescriptor. + optional int64 payload_id = 3; + + // The human-readable name of the package that should be displayed as + // attribution if no other information is available (i.e. the package is not + // installed locally yet). + optional string attributed_app_name = 4; +} + +// A frame used when sending messages over the wire. +// NEXT_ID=3 +message Frame { + enum Version { + UNKNOWN_VERSION = 0; + V1 = 1; + } + optional Version version = 1; + + // Right now there's only 1 version, but if there are more, exactly one of + // the following fields will be set. + optional V1Frame v1 = 2; +} + +// NEXT_ID=8 +message V1Frame { + enum FrameType { + UNKNOWN_FRAME_TYPE = 0; + INTRODUCTION = 1; + RESPONSE = 2; + PAIRED_KEY_ENCRYPTION = 3; + PAIRED_KEY_RESULT = 4; + // No longer used. + CERTIFICATE_INFO = 5; + CANCEL = 6; + // No longer used. + PROGRESS_UPDATE = 7; + } + + optional FrameType type = 1; + + // At most one of the following fields will be set. + optional IntroductionFrame introduction = 2; + optional ConnectionResponseFrame connection_response = 3; + optional PairedKeyEncryptionFrame paired_key_encryption = 4; + optional PairedKeyResultFrame paired_key_result = 5; + optional CertificateInfoFrame certificate_info = 6 [deprecated = true]; + optional ProgressUpdateFrame progress_update = 7 [deprecated = true]; +} + +// An introduction packet sent by the sending side. Contains a list of files +// they'd like to share. +// NEXT_ID=10 +message IntroductionFrame { + enum SharingUseCase { + UNKNOWN = 0; + NEARBY_SHARE = 1; + REMOTE_COPY = 2; + } + + repeated FileMetadata file_metadata = 1; + repeated TextMetadata text_metadata = 2; + // The required app package to open the content. May be null. + optional string required_package = 3; + repeated WifiCredentialsMetadata wifi_credentials_metadata = 4; + repeated AppMetadata app_metadata = 5; + optional bool start_transfer = 6; + repeated StreamMetadata stream_metadata = 7; + optional SharingUseCase use_case = 8; + repeated int64 preview_payload_ids = 9; +} + +// A progress update packet sent by the sending side. Contains transfer progress +// value. NEXT_ID=3 +message ProgressUpdateFrame { + optional float progress = 1; + + // True, if the receiver should start bandwidth upgrade and receiving the + // payloads. + optional bool start_transfer = 2; +} + +// A response packet sent by the receiving side. Accepts or rejects the list of +// files. +// NEXT_ID=4 +message ConnectionResponseFrame { + enum Status { + UNKNOWN = 0; + ACCEPT = 1; + REJECT = 2; + NOT_ENOUGH_SPACE = 3; + UNSUPPORTED_ATTACHMENT_TYPE = 4; + TIMED_OUT = 5; + } + + // The receiving side's response. + optional Status status = 1; + + // Key is attachment hash, value is the details of attachment. + map attachment_details = 2; + + // In the case of a stream attachments, the other side of the pipe. + // Both sender and receiver should validate matching counts. + repeated StreamMetadata stream_metadata = 3; +} + +// Attachment details that sent in ConnectionResponseFrame. +// NEXT_ID=3 +message AttachmentDetails { + // LINT.IfChange + enum Type { + UNKNOWN = 0; + // Represents FileAttachment. + FILE = 1; + // Represents TextAttachment. + TEXT = 2; + // Represents WifiCredentialsAttachment. + WIFI_CREDENTIALS = 3; + // Represents AppAttachment. + APP = 4; + // Represents StreamAttachment. + STREAM = 5; + } + // LINT.ThenChange(//depot/google3/java/com/google/android/gmscore/integ/client/nearby/src/com/google/android/gms/nearby/sharing/Attachment.java) + + // The attachment family type. + optional Type type = 1; + + // This field is only for FILE type. + optional FileAttachmentDetails file_attachment_details = 2; +} + +// File attachment details included in ConnectionResponseFrame. +// NEXT_ID=3 +message FileAttachmentDetails { + // Existing local file size on receiver side. + optional int64 receiver_existing_file_size = 1; + + // The key is attachment hash, a stable identifier for the attachment. + // Value is list of payload details transferred for the attachment. + map attachment_hash_payloads = 2; +} + +// NEXT_ID=2 +message PayloadsDetails { + // The list should be sorted by creation timestamp. + repeated PayloadDetails payload_details = 1; +} + +// Metadata of a payload file created by Nearby Connections. +// NEXT_ID=4 +message PayloadDetails { + optional int64 id = 1; + optional int64 creation_timestamp_millis = 2; + optional int64 size = 3; +} + +// A paired key encryption packet sent between devices, contains signed data. +// NEXT_ID=5 +message PairedKeyEncryptionFrame { + // The encrypted data in byte array format. + optional bytes signed_data = 1; + + // The hash of a certificate id. + optional bytes secret_id_hash = 2; + + // An optional encrypted data in byte array format. + optional bytes optional_signed_data = 3; + + // An optional QR code handshake data in a byte array format. + // For incoming connection contains a signature of the UKEY2 + // token, created with the sender's private key. + // For outgoing connection contains an HKDF of the connection token and of the + // UKEY2 token + optional bytes qr_code_handshake_data = 4; +} + +// A paired key verification result packet sent between devices. +// NEXT_ID=3 +message PairedKeyResultFrame { + enum Status { + UNKNOWN = 0; + SUCCESS = 1; + FAIL = 2; + UNABLE = 3; + } + + // The verification result. + optional Status status = 1; + + // OS type. + optional location.nearby.proto.sharing.OSType os_type = 2; +} + +// A package containing certificate info to be shared to remote device offline. +// NEXT_ID=2 +message CertificateInfoFrame { + // The public certificates to be shared with remote devices. + repeated PublicCertificate public_certificate = 1; +} + +// A public certificate from the local device. +// NEXT_ID=8 +message PublicCertificate { + // The unique id of the public certificate. + optional bytes secret_id = 1; + + // A bytes representation of a Secret Key owned by contact, to decrypt the + // metadata_key stored within the advertisement. + optional bytes authenticity_key = 2; + + // A bytes representation a public key of X509Certificate, owned by contact, + // to decrypt encrypted UKEY2 (from Nearby Connections API) as a hand shake in + // contact verification phase. + optional bytes public_key = 3; + + // The time in millis from epoch when this certificate becomes effective. + optional int64 start_time = 4; + + // The time in millis from epoch when this certificate expires. + optional int64 end_time = 5; + + // The encrypted metadata in bytes, contains personal information of the + // device/user who created this certificate. Needs to be decrypted into bytes, + // and converted back to EncryptedMetadata object to access fields. + optional bytes encrypted_metadata_bytes = 6; + + // The tag for verifying metadata_encryption_key. + optional bytes metadata_encryption_key_tag = 7; +} + +// NEXT_ID=3 +message WifiCredentials { + // Wi-Fi password. + optional string password = 1 + /* type = ST_ACCOUNT_CREDENTIAL */; + // True if the network is a hidden network that is not broadcasting its SSID. + // Default is false. + optional bool hidden_ssid = 2 [default = false]; +} + +// NEXT_ID=2 +message StreamDetails { + // Serialized ParcelFileDescriptor for input stream (for the receiver). + optional bytes input_stream_parcel_file_descriptor_bytes = 1; +} diff --git a/airsync-mac/Core/WidgetDataManager.swift b/airsync-mac/Core/WidgetDataManager.swift new file mode 100644 index 00000000..72eacc77 --- /dev/null +++ b/airsync-mac/Core/WidgetDataManager.swift @@ -0,0 +1,57 @@ +// +// WidgetDataManager.swift +// airsync-mac +// +// Manages shared data between the main app and widgets using App Groups. + +import Foundation +import WidgetKit + +class WidgetDataManager { + static let shared = WidgetDataManager() + + private let appGroupIdentifier = "group.sameerasw.airsync-mac.widget" + + private var sharedDefaults: UserDefaults? { + UserDefaults(suiteName: appGroupIdentifier) + } + + func updateWidgetData(deviceStatus: DeviceStatus?, deviceName: String, wallpaperBase64: String? = nil, isLocalNetwork: Bool = false, isBLEConnected: Bool = false, isADBConnected: Bool = false, adbMode: String = "wireless") { + guard let shared = sharedDefaults else { + print("[Widget] App Groups container not available - check App Groups capability") + return + } + + let isPaired = deviceStatus?.isPaired ?? false + let batteryLevel = deviceStatus?.battery.level ?? 0 + let isCharging = deviceStatus?.battery.isCharging ?? false + + shared.set(deviceName, forKey: "deviceName") + shared.set(batteryLevel, forKey: "batteryLevel") + shared.set(isCharging, forKey: "isCharging") + shared.set(isPaired, forKey: "isPaired") + + if let base64 = wallpaperBase64 { + shared.set(base64, forKey: "wallpaperBase64") + } + + shared.set(isLocalNetwork, forKey: "isLocalNetwork") + shared.set(isBLEConnected, forKey: "isBLEConnected") + shared.set(isADBConnected, forKey: "isADBConnected") + shared.set(adbMode, forKey: "adbMode") + + let isMusicPlaying = deviceStatus?.music?.isPlaying ?? false + shared.set(isMusicPlaying, forKey: "isMusicPlaying") + shared.set(deviceStatus?.music?.title ?? "", forKey: "musicTitle") + shared.set(deviceStatus?.music?.artist ?? "", forKey: "musicArtist") + shared.set(deviceStatus?.music?.albumArt ?? "", forKey: "musicAlbumArt") + + shared.synchronize() + + print("[Widget] Updated: \(deviceName), Battery: \(batteryLevel)%, Paired: \(isPaired)") + + DispatchQueue.main.async { + WidgetCenter.shared.reloadAllTimelines() + } + } +}