Skip to content

Commit

Permalink
Merge pull request #242 from joshzana/4.8.2_update
Browse files Browse the repository at this point in the history
4.8.2 release.
  • Loading branch information
joshzana authored Dec 5, 2018
2 parents 2ef186e + 83ebc4e commit 7285db5
Show file tree
Hide file tree
Showing 23 changed files with 1,283 additions and 282 deletions.
2 changes: 2 additions & 0 deletions .jazzy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"name": "Routes",
"children": [
"AuthRoutes",
"ContactsRoutes",
"FilePropertiesRoutes",
"FileRequestsRoutes",
"FilesRoutes",
Expand All @@ -22,6 +23,7 @@
"Async",
"Auth",
"Common",
"Contacts",
"FileProperties",
"FileRequests",
"Files",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ To install the Dropbox Swift SDK via Carthage, you need to create a `Cartfile` i

```
# SwiftyDropbox
github "https://github.com/dropbox/SwiftyDropbox" ~> 4.8.1
github "https://github.com/dropbox/SwiftyDropbox" ~> 4.8.2
```

Then, run the following command to install the dependency to checkout and build the Dropbox Swift SDK repository:
Expand Down
2 changes: 1 addition & 1 deletion Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.8.1</string>
<string>4.8.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.8.1</string>
<string>4.8.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
3 changes: 3 additions & 0 deletions Source/SwiftyDropbox/Shared/Generated/Base.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Alamofire
open class DropboxBase {
/// Routes within the auth namespace. See AuthRoutes for details.
open var auth: AuthRoutes!
/// Routes within the contacts namespace. See ContactsRoutes for details.
open var contacts: ContactsRoutes!
/// Routes within the file_properties namespace. See FilePropertiesRoutes for details.
open var file_properties: FilePropertiesRoutes!
/// Routes within the file_requests namespace. See FileRequestsRoutes for details.
Expand All @@ -28,6 +30,7 @@ open class DropboxBase {

public init(client: DropboxTransportClient) {
self.auth = AuthRoutes(client: client)
self.contacts = ContactsRoutes(client: client)
self.file_properties = FilePropertiesRoutes(client: client)
self.file_requests = FileRequestsRoutes(client: client)
self.files = FilesRoutes(client: client)
Expand Down
112 changes: 112 additions & 0 deletions Source/SwiftyDropbox/Shared/Generated/Contacts.swift
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 Source/SwiftyDropbox/Shared/Generated/ContactsRoutes.swift
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)
}

}
4 changes: 2 additions & 2 deletions Source/SwiftyDropbox/Shared/Generated/FileRequests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ open class FileRequests {
/// The path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder
/// permission, this will be relative to the app folder.
public let destination: String
/// The deadline for the file request. Deadlines can only be set by Pro and Business accounts.
/// The deadline for the file request. Deadlines can only be set by Professional and Business accounts.
public let deadline: FileRequests.FileRequestDeadline?
/// Whether or not the file request should be open. If the file request is closed, it will not accept any file
/// submissions, but it can be opened later.
Expand Down Expand Up @@ -695,7 +695,7 @@ open class FileRequests {
/// The new path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder
/// permission, this will be relative to the app folder.
public let destination: String?
/// The new deadline for the file request.
/// The new deadline for the file request. Deadlines can only be set by Professional and Business accounts.
public let deadline: FileRequests.UpdateFileRequestDeadline
/// Whether to set this file request as open or closed.
public let open: Bool?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ open class FileRequestsRoutes {
/// - parameter title: The title of the file request. Must not be empty.
/// - parameter destination: The path of the folder in the Dropbox where uploaded files will be sent. For apps with
/// the app folder permission, this will be relative to the app folder.
/// - parameter deadline: The deadline for the file request. Deadlines can only be set by Pro and Business accounts.
/// - parameter deadline: The deadline for the file request. Deadlines can only be set by Professional and Business
/// accounts.
/// - parameter open: Whether or not the file request should be open. If the file request is closed, it will not
/// accept any file submissions, but it can be opened later.
///
Expand Down Expand Up @@ -57,7 +58,8 @@ open class FileRequestsRoutes {
/// - parameter title: The new title of the file request. Must not be empty.
/// - parameter destination: The new path of the folder in the Dropbox where uploaded files will be sent. For apps
/// with the app folder permission, this will be relative to the app folder.
/// - parameter deadline: The new deadline for the file request.
/// - parameter deadline: The new deadline for the file request. Deadlines can only be set by Professional and
/// Business accounts.
/// - parameter open: Whether to set this file request as open or closed.
///
/// - returns: Through the response callback, the caller will receive a `FileRequests.FileRequest` object on
Expand Down
Loading

0 comments on commit 7285db5

Please sign in to comment.