Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Client' is ambiguous for type lookup in this context #21

Closed
joninsky opened this issue May 15, 2018 · 2 comments
Closed

'Client' is ambiguous for type lookup in this context #21

joninsky opened this issue May 15, 2018 · 2 comments

Comments

@joninsky
Copy link

While integrating Filestack into my project I ran into a build time error "'Client' is ambiguous for type lookup in this context"

Here is the code that produces the issue:

struct FileStackAbstractor {
    //MARK: Properties
    
    //MARK: Init
    init() {
        
    }
    
    //MARK: Functions
    func retrievePolicy() -> Policy {
        let oneDayInSeconds: TimeInterval = 60 * 60 * 24
        return Policy(expiry: Date(timeIntervalSinceNow: oneDayInSeconds), call: [PolicyCall.pick, PolicyCall.read, PolicyCall.store])
    }
    
    func retrieveSecurity() throws -> Security {
        let keys = UEFileStackKeys()
        return try Security(policy: self.retrievePolicy(), appSecret: keys.secret)
    }
    
    func retrieveClient() throws -> Client {
        let security = try self.retrieveSecurity()
        let config = Filestack.Config()
        let keys = UEFileStackKeys()
        let client = Filestack.Client(apiKey: keys.appID, security: security, config: config, token: nil)
        return client
    }
    
}

The error comes from the last function in the struct. Both the Filestack and FilestackSDK pods seem to have a Client object.

@joninsky
Copy link
Author

You can reference the correct client by referring to the name space:

Filestack.Client
FilestackSDK.Client

@pappApproved
Copy link
Contributor

You are right. That is a proper way to use specific Client classes.
Nevertheless, this should be documented. We will make sure that it appears there on next version.
Thanks for pointing that.

Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants