File: StoneBase.swift

package info (click to toggle)
python-stone 3.3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,036 kB
  • sloc: python: 22,311; objc: 498; sh: 23; makefile: 11
file content (56 lines) | stat: -rw-r--r-- 1,478 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///

import Foundation

// The objects in this file are used by generated code and should not need to be invoked manually.

public enum RouteAuth: String {
    case app
    case user
    case team
    case noauth
}

public enum RouteHost: String {
    case api
    case content
    case notify
}

public enum RouteStyle: String {
    case rpc
    case upload
    case download
}

public struct RouteAttributes {
    let auth: [RouteAuth]
    let host: RouteHost
    let style: RouteStyle
}

public class Route<ASerial: JSONSerializer, RSerial: JSONSerializer, ESerial: JSONSerializer> {
    public let name: String
    public let version: Int32
    public let namespace: String
    public let deprecated: Bool
    public let argSerializer: ASerial
    public let responseSerializer: RSerial
    public let errorSerializer: ESerial
    public let attributes: RouteAttributes

    public init(name: String, version: Int32, namespace: String, deprecated: Bool,
                argSerializer: ASerial, responseSerializer: RSerial, errorSerializer: ESerial,
                attributes: RouteAttributes) {
        self.name = name
        self.version = version
        self.namespace = namespace
        self.deprecated = deprecated
        self.argSerializer = argSerializer
        self.responseSerializer = responseSerializer
        self.errorSerializer = errorSerializer
        self.attributes = attributes
    }
}