File: ObjCClient.jinja

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 (35 lines) | stat: -rw-r--r-- 911 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
///
/// Copyright (c) 2022 Dropbox, Inc. All rights reserved.
///
/// Auto-generated by Stone, do not modify.
///

import Foundation
import SwiftyDropbox

/// Objective-C compatible {{ class_name }}.
/// For Swift see {{ class_name }}.
@objc
public class DBX{{ class_name }}: NSObject {
    let swift: {{ class_name }}

    {% for var, type in namespace_fields %}
    /// Routes within the {{ var }} namespace. See DB{{ type }}Routes for details.
    @objc
    public var {{ var }}: DBX{{ type }}Routes!
    {% endfor %}

    @objc
    public convenience init(client: DBXDropboxTransportClient) {
        self.init(swiftClient: client.swift)
    }

    public init(swiftClient: DropboxTransportClient) {
        self.swift = {{ class_name }}(client: swiftClient)

        {% for var, type in namespace_fields %}
        self.{{ var }} = DBX{{ type }}Routes(swift: swift.{{ var }})
        {% endfor %}
    }
}