Skip to content

Commit

Permalink
Regenerate routes
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlocke committed Mar 14, 2023
1 parent fa10594 commit 0300a0f
Show file tree
Hide file tree
Showing 7 changed files with 1,008 additions and 321 deletions.
134 changes: 45 additions & 89 deletions Source/SwiftyDropbox/Shared/Generated/Openid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,50 @@ import Foundation

/// Datatypes and serializers for the openid namespace
open class Openid {
/// The AuthError union
public enum AuthError: CustomStringConvertible {
/// An unspecified error.
case invalidToken
/// An unspecified error.
case noOpenidAuth
/// The OpenIdError union
public enum OpenIdError: CustomStringConvertible {
/// Missing openid claims for the associated access token.
case incorrectOpenidScopes
/// An unspecified error.
case other

public var description: String {
return "\(SerializeUtil.prepareJSONForSerialization(AuthErrorSerializer().serialize(self)))"
return "\(SerializeUtil.prepareJSONForSerialization(OpenIdErrorSerializer().serialize(self)))"
}
}
open class AuthErrorSerializer: JSONSerializer {
open class OpenIdErrorSerializer: JSONSerializer {
public init() { }
open func serialize(_ value: AuthError) -> JSON {
open func serialize(_ value: OpenIdError) -> JSON {
switch value {
case .invalidToken:
var d = [String: JSON]()
d[".tag"] = .str("invalid_token")
return .dictionary(d)
case .noOpenidAuth:
case .incorrectOpenidScopes:
var d = [String: JSON]()
d[".tag"] = .str("no_openid_auth")
d[".tag"] = .str("incorrect_openid_scopes")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
return .dictionary(d)
}
}
open func deserialize(_ json: JSON) -> AuthError {
open func deserialize(_ json: JSON) -> OpenIdError {
switch json {
case .dictionary(let d):
let tag = Serialization.getTag(d)
switch tag {
case "invalid_token":
return AuthError.invalidToken
case "no_openid_auth":
return AuthError.noOpenidAuth
case "incorrect_openid_scopes":
return OpenIdError.incorrectOpenidScopes
case "other":
return AuthError.other
return OpenIdError.other
default:
return AuthError.other
return OpenIdError.other
}
default:
fatalError("Failed to deserialize")
}
}
}

/// This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone.
/// No Parameters
open class UserInfoArgs: CustomStringConvertible {
public init() {
}
Expand All @@ -83,38 +75,46 @@ open class Openid {
}
}

/// The UserInfoError struct
open class UserInfoError: CustomStringConvertible {
/// (no description)
public let err: Openid.ErrUnion?
/// Brief explanation of the error.
public let errorMessage: String
public init(err: Openid.ErrUnion? = nil, errorMessage: String = "") {
self.err = err
stringValidator()(errorMessage)
self.errorMessage = errorMessage
}
open var description: String {
/// The UserInfoError union
public enum UserInfoError: CustomStringConvertible {
/// An unspecified error.
case openidError(Openid.OpenIdError)
/// An unspecified error.
case other

public var description: String {
return "\(SerializeUtil.prepareJSONForSerialization(UserInfoErrorSerializer().serialize(self)))"
}
}
open class UserInfoErrorSerializer: JSONSerializer {
public init() { }
open func serialize(_ value: UserInfoError) -> JSON {
let output = [
"err": NullableSerializer(Openid.ErrUnionSerializer()).serialize(value.err),
"error_message": Serialization._StringSerializer.serialize(value.errorMessage),
]
return .dictionary(output)
switch value {
case .openidError(let arg):
var d = ["openid_error": Openid.OpenIdErrorSerializer().serialize(arg)]
d[".tag"] = .str("openid_error")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
return .dictionary(d)
}
}
open func deserialize(_ json: JSON) -> UserInfoError {
switch json {
case .dictionary(let dict):
let err = NullableSerializer(Openid.ErrUnionSerializer()).deserialize(dict["err"] ?? .null)
let errorMessage = Serialization._StringSerializer.deserialize(dict["error_message"] ?? .str(""))
return UserInfoError(err: err, errorMessage: errorMessage)
case .dictionary(let d):
let tag = Serialization.getTag(d)
switch tag {
case "openid_error":
let v = Openid.OpenIdErrorSerializer().deserialize(d["openid_error"] ?? .null)
return UserInfoError.openidError(v)
case "other":
return UserInfoError.other
default:
return UserInfoError.other
}
default:
fatalError("Type error deserializing")
fatalError("Failed to deserialize")
}
}
}
Expand Down Expand Up @@ -180,50 +180,6 @@ open class Openid {
}
}

/// The ErrUnion union
public enum ErrUnion: CustomStringConvertible {
/// An unspecified error.
case authError(Openid.AuthError)
/// An unspecified error.
case other

public var description: String {
return "\(SerializeUtil.prepareJSONForSerialization(ErrUnionSerializer().serialize(self)))"
}
}
open class ErrUnionSerializer: JSONSerializer {
public init() { }
open func serialize(_ value: ErrUnion) -> JSON {
switch value {
case .authError(let arg):
var d = ["auth_error": Openid.AuthErrorSerializer().serialize(arg)]
d[".tag"] = .str("auth_error")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
return .dictionary(d)
}
}
open func deserialize(_ json: JSON) -> ErrUnion {
switch json {
case .dictionary(let d):
let tag = Serialization.getTag(d)
switch tag {
case "auth_error":
let v = Openid.AuthErrorSerializer().deserialize(d["auth_error"] ?? .null)
return ErrUnion.authError(v)
case "other":
return ErrUnion.other
default:
return ErrUnion.other
}
default:
fatalError("Failed to deserialize")
}
}
}


/// Stone Route Objects

Expand Down
8 changes: 8 additions & 0 deletions Source/SwiftyDropbox/Shared/Generated/Sharing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6226,6 +6226,8 @@ open class Sharing {
case editor
/// Request for the maximum access level you can set the link to.
case max
/// Request for the default access level the user has set.
case default_
/// An unspecified error.
case other

Expand All @@ -6249,6 +6251,10 @@ open class Sharing {
var d = [String: JSON]()
d[".tag"] = .str("max")
return .dictionary(d)
case .default_:
var d = [String: JSON]()
d[".tag"] = .str("default")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
Expand All @@ -6266,6 +6272,8 @@ open class Sharing {
return RequestedLinkAccessLevel.editor
case "max":
return RequestedLinkAccessLevel.max
case "default":
return RequestedLinkAccessLevel.default_
case "other":
return RequestedLinkAccessLevel.other
default:
Expand Down
Loading

0 comments on commit 0300a0f

Please sign in to comment.