-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from joshzana/4.8.2_update
4.8.2 release.
- Loading branch information
Showing
23 changed files
with
1,283 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/// | ||
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. | ||
/// | ||
/// Auto-generated by Stone, do not modify. | ||
/// | ||
|
||
import Foundation | ||
|
||
/// Datatypes and serializers for the contacts namespace | ||
open class Contacts { | ||
/// The DeleteManualContactsArg struct | ||
open class DeleteManualContactsArg: CustomStringConvertible { | ||
/// List of manually added contacts to be deleted. | ||
public let emailAddresses: Array<String> | ||
public init(emailAddresses: Array<String>) { | ||
arrayValidator(itemValidator: stringValidator(maxLength: 255, pattern: "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$"))(emailAddresses) | ||
self.emailAddresses = emailAddresses | ||
} | ||
open var description: String { | ||
return "\(SerializeUtil.prepareJSONForSerialization(DeleteManualContactsArgSerializer().serialize(self)))" | ||
} | ||
} | ||
open class DeleteManualContactsArgSerializer: JSONSerializer { | ||
public init() { } | ||
open func serialize(_ value: DeleteManualContactsArg) -> JSON { | ||
let output = [ | ||
"email_addresses": ArraySerializer(Serialization._StringSerializer).serialize(value.emailAddresses), | ||
] | ||
return .dictionary(output) | ||
} | ||
open func deserialize(_ json: JSON) -> DeleteManualContactsArg { | ||
switch json { | ||
case .dictionary(let dict): | ||
let emailAddresses = ArraySerializer(Serialization._StringSerializer).deserialize(dict["email_addresses"] ?? .null) | ||
return DeleteManualContactsArg(emailAddresses: emailAddresses) | ||
default: | ||
fatalError("Type error deserializing") | ||
} | ||
} | ||
} | ||
|
||
/// The DeleteManualContactsError union | ||
public enum DeleteManualContactsError: CustomStringConvertible { | ||
/// Can't delete contacts from this list. Make sure the list only has manually added contacts. The deletion was | ||
/// cancelled. | ||
case contactsNotFound(Array<String>) | ||
/// An unspecified error. | ||
case other | ||
|
||
public var description: String { | ||
return "\(SerializeUtil.prepareJSONForSerialization(DeleteManualContactsErrorSerializer().serialize(self)))" | ||
} | ||
} | ||
open class DeleteManualContactsErrorSerializer: JSONSerializer { | ||
public init() { } | ||
open func serialize(_ value: DeleteManualContactsError) -> JSON { | ||
switch value { | ||
case .contactsNotFound(let arg): | ||
var d = ["contacts_not_found": ArraySerializer(Serialization._StringSerializer).serialize(arg)] | ||
d[".tag"] = .str("contacts_not_found") | ||
return .dictionary(d) | ||
case .other: | ||
var d = [String: JSON]() | ||
d[".tag"] = .str("other") | ||
return .dictionary(d) | ||
} | ||
} | ||
open func deserialize(_ json: JSON) -> DeleteManualContactsError { | ||
switch json { | ||
case .dictionary(let d): | ||
let tag = Serialization.getTag(d) | ||
switch tag { | ||
case "contacts_not_found": | ||
let v = ArraySerializer(Serialization._StringSerializer).deserialize(d["contacts_not_found"] ?? .null) | ||
return DeleteManualContactsError.contactsNotFound(v) | ||
case "other": | ||
return DeleteManualContactsError.other | ||
default: | ||
return DeleteManualContactsError.other | ||
} | ||
default: | ||
fatalError("Failed to deserialize") | ||
} | ||
} | ||
} | ||
|
||
|
||
/// Stone Route Objects | ||
|
||
static let deleteManualContacts = Route( | ||
name: "delete_manual_contacts", | ||
version: 1, | ||
namespace: "contacts", | ||
deprecated: false, | ||
argSerializer: Serialization._VoidSerializer, | ||
responseSerializer: Serialization._VoidSerializer, | ||
errorSerializer: Serialization._VoidSerializer, | ||
attrs: ["host": "api", | ||
"style": "rpc"] | ||
) | ||
static let deleteManualContactsBatch = Route( | ||
name: "delete_manual_contacts_batch", | ||
version: 1, | ||
namespace: "contacts", | ||
deprecated: false, | ||
argSerializer: Contacts.DeleteManualContactsArgSerializer(), | ||
responseSerializer: Serialization._VoidSerializer, | ||
errorSerializer: Contacts.DeleteManualContactsErrorSerializer(), | ||
attrs: ["host": "api", | ||
"style": "rpc"] | ||
) | ||
} |
37 changes: 37 additions & 0 deletions
37
Source/SwiftyDropbox/Shared/Generated/ContactsRoutes.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/// | ||
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved. | ||
/// | ||
/// Auto-generated by Stone, do not modify. | ||
/// | ||
|
||
/// Routes for the contacts namespace | ||
open class ContactsRoutes { | ||
public let client: DropboxTransportClient | ||
init(client: DropboxTransportClient) { | ||
self.client = client | ||
} | ||
|
||
/// Removes all manually added contacts. You'll still keep contacts who are on your team or who you imported. New | ||
/// contacts will be added when you share. | ||
/// | ||
/// | ||
/// - returns: Through the response callback, the caller will receive a `Void` object on success or a `Void` object | ||
/// on failure. | ||
@discardableResult open func deleteManualContacts() -> RpcRequest<VoidSerializer, VoidSerializer> { | ||
let route = Contacts.deleteManualContacts | ||
return client.request(route) | ||
} | ||
|
||
/// Removes manually added contacts from the given list. | ||
/// | ||
/// - parameter emailAddresses: List of manually added contacts to be deleted. | ||
/// | ||
/// - returns: Through the response callback, the caller will receive a `Void` object on success or a | ||
/// `Contacts.DeleteManualContactsError` object on failure. | ||
@discardableResult open func deleteManualContactsBatch(emailAddresses: Array<String>) -> RpcRequest<VoidSerializer, Contacts.DeleteManualContactsErrorSerializer> { | ||
let route = Contacts.deleteManualContactsBatch | ||
let serverArgs = Contacts.DeleteManualContactsArg(emailAddresses: emailAddresses) | ||
return client.request(route, serverArgs: serverArgs) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.