// // Copyright Amazon.com Inc. or its affiliates. // All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // import Amplify import AWSPluginsCore import Foundation struct InformSessionFetched: Action { let identifier = "InformSessionFetched" let identityID: IdentityID let credentials: AuthAWSCognitoCredentials func execute(withDispatcher dispatcher: EventDispatcher, environment: Environment) async { logVerbose("\(#fileID) Starting execution", environment: environment) let event = AuthorizationEvent(eventType: .fetched(identityID, credentials)) logVerbose("\(#fileID) Sending event \(event.type)", environment: environment) await dispatcher.send(event) } } extension InformSessionFetched: DefaultLogger { public static var log: Logger { Amplify.Logging.logger(forCategory: CategoryType.auth.displayName, forNamespace: String(describing: self)) } public var log: Logger { Self.log } } extension InformSessionFetched: CustomDebugDictionaryConvertible { var debugDictionary: [String: Any] { [ "identifier": identifier ] } } extension InformSessionFetched: CustomDebugStringConvertible { var debugDescription: String { debugDictionary.debugDescription } }