From 732ac7774ee1ed8461a315b914b1756f3941bfca Mon Sep 17 00:00:00 2001 From: Marco Burstein Date: Sat, 14 Apr 2018 08:44:46 -0700 Subject: [PATCH] Make API functions `public`. --- sources/SwiftZulipAPI/config.swift | 2 +- sources/SwiftZulipAPI/events.swift | 8 ++++---- sources/SwiftZulipAPI/messages.swift | 10 +++++----- sources/SwiftZulipAPI/streams.swift | 12 ++++++------ sources/SwiftZulipAPI/users.swift | 8 ++++---- sources/SwiftZulipAPI/zulip.swift | 10 +++++----- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sources/SwiftZulipAPI/config.swift b/sources/SwiftZulipAPI/config.swift index 030f5ad..b5b7195 100644 --- a/sources/SwiftZulipAPI/config.swift +++ b/sources/SwiftZulipAPI/config.swift @@ -24,7 +24,7 @@ public class Config { - realmURL: The URL of a Zulip realm. - Example: https://chat.zulip.org */ - init( + public init( emailAddress: String, apiKey: String, realmURL: String diff --git a/sources/SwiftZulipAPI/events.swift b/sources/SwiftZulipAPI/events.swift index c07c33c..6310bf0 100644 --- a/sources/SwiftZulipAPI/events.swift +++ b/sources/SwiftZulipAPI/events.swift @@ -25,7 +25,7 @@ public class Events { - Parameters: - config: The `Config` to use. */ - init(config: Config) { + public init(config: Config) { self.config = config } @@ -70,7 +70,7 @@ public class Events { `last_event_id`, the initial event ID to receive an event with, or an error if there is one. */ - func register( + public func register( applyMarkdown: Bool = false, clientGravatar: Bool = false, eventTypes: [String] = [], @@ -181,7 +181,7 @@ public class Events { - callback: A callback, which will be passed a list of events, or an error, if there is one. */ - func get( + public func get( queueID: String, lastEventID: Int, dontBlock: Bool = false, @@ -225,7 +225,7 @@ public class Events { - callback: A callback, which will be passed an error if there is one. */ - func deleteQueue( + public func deleteQueue( queueID: String, callback: @escaping (Error?) -> Void ) { diff --git a/sources/SwiftZulipAPI/messages.swift b/sources/SwiftZulipAPI/messages.swift index 2d3f11e..55ae545 100644 --- a/sources/SwiftZulipAPI/messages.swift +++ b/sources/SwiftZulipAPI/messages.swift @@ -28,7 +28,7 @@ public class Messages { - Parameters: - config: The `Config` to use. */ - init(config: Config) { + public init(config: Config) { self.config = config } @@ -49,7 +49,7 @@ public class Messages { - callback: A callback, which will be passed the ID of the new message, or an error. */ - func send( + public func send( messageType: MessageType, to: String, subject: String?, @@ -114,7 +114,7 @@ public class Messages { - callback: A callback, which will be passed the messages, or an error. */ - func get( + public func get( narrow: [Any], anchor: Int, amountBefore: Int, @@ -177,7 +177,7 @@ public class Messages { - callback: A callback, which will be passed the rendered HTML string, or an `Error`. */ - func render( + public func render( content: String, callback: @escaping (String?, Error?) -> Void ) { @@ -218,7 +218,7 @@ public class Messages { - callback: A callback, which will be passed an Error if there is one. */ - func update( + public func update( messageID: Int, content: String, callback: @escaping (Error?) -> Void diff --git a/sources/SwiftZulipAPI/streams.swift b/sources/SwiftZulipAPI/streams.swift index ceb0065..93ffca7 100644 --- a/sources/SwiftZulipAPI/streams.swift +++ b/sources/SwiftZulipAPI/streams.swift @@ -26,7 +26,7 @@ public class Streams { - Parameters: - config: The `Config` to use. */ - init(config: Config) { + public init(config: Config) { self.config = config } @@ -43,7 +43,7 @@ public class Streams { - callback: A callback, which will be passed the streams, or an error. */ - func getAll( + public func getAll( includePublic: Bool = true, includeSubscribed: Bool = true, includeDefault: Bool = false, @@ -91,7 +91,7 @@ public class Streams { - name: The name of the stream. - callback: A callback, which will be passed the ID, or an error. */ - func getID( + public func getID( name: String, callback: @escaping (Int?, Error?) -> Void ) { @@ -130,7 +130,7 @@ public class Streams { - callback: A callback, which will be passed the streams, or an error. */ - func getSubscribed( + public func getSubscribed( callback: @escaping ( [[String: Any]]?, Error? @@ -181,7 +181,7 @@ public class Streams { and a list of names of streams that could not be subscribed to because the user was unauthorized; or an error if there is one. */ - func subscribe( + public func subscribe( streams: [[String: Any]], inviteOnly: Bool = false, announce: Bool = false, @@ -282,7 +282,7 @@ public class Streams { the streams that could not be unsubscrived from because the user was already subscribed, or an error if there is one. */ - func unsubscribe( + public func unsubscribe( streamNames: [String], principals: [String] = [], callback: @escaping ( diff --git a/sources/SwiftZulipAPI/users.swift b/sources/SwiftZulipAPI/users.swift index 28f4516..3fffe69 100644 --- a/sources/SwiftZulipAPI/users.swift +++ b/sources/SwiftZulipAPI/users.swift @@ -13,7 +13,7 @@ public class Users { - Parameters: - config: The `Config` to use. */ - init(config: Config) { + public init(config: Config) { self.config = config } @@ -28,7 +28,7 @@ public class Users { - callback: A callback, which will be passed a list of users, or an error if there is one. */ - func getAll( + public func getAll( clientGravatar: Bool = false, callback: @escaping ([[String: Any]]?, Error?) -> Void ) { @@ -67,7 +67,7 @@ public class Users { - callback: A callback, which will be passed the profile, or an error if there is one. */ - func getCurrent( + public func getCurrent( clientGravatar: Bool = false, callback: @escaping ([String: Any]?, Error?) -> Void ) { @@ -121,7 +121,7 @@ public class Users { - callback: A callback, which will be passed an error if there is one. */ - func create( + public func create( email: String, password: String, fullName: String, diff --git a/sources/SwiftZulipAPI/zulip.swift b/sources/SwiftZulipAPI/zulip.swift index 39efb47..6e16d42 100644 --- a/sources/SwiftZulipAPI/zulip.swift +++ b/sources/SwiftZulipAPI/zulip.swift @@ -12,7 +12,7 @@ public class Zulip { - Parameters: - config: The `Config` to use. */ - init(config: Config) { + public init(config: Config) { self.config = config } @@ -21,7 +21,7 @@ public class Zulip { - Returns: The `Messages` client. */ - func messages() -> Messages { + public func messages() -> Messages { return Messages(config: self.config) } @@ -30,7 +30,7 @@ public class Zulip { - Returns: The `Streams` client. */ - func streams() -> Streams { + public func streams() -> Streams { return Streams(config: self.config) } @@ -39,7 +39,7 @@ public class Zulip { - Returns: The `Users` client. */ - func users() -> Users { + public func users() -> Users { return Users(config: self.config) } @@ -48,7 +48,7 @@ public class Zulip { - Returns: The `Events` client. */ - func events() -> Events { + public func events() -> Events { return Events(config: self.config) } }