Skip to content

Commit

Permalink
feat: move notification suppression to public schema (box/box-openapi…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build authored May 16, 2024
1 parent 4fa69f0 commit 069be60
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "3eadef2", "specHash": "f26f46d", "version": "0.1.0" }
{ "engineHash": "3eadef2", "specHash": "6c3dd22", "version": "0.1.0" }
5 changes: 3 additions & 2 deletions Sources/Schemas/SignRequest/SignRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public class SignRequest: SignRequestBase {
/// - externalId: This can be used to reference an ID in an external system that the sign request is related to.
/// - isPhoneVerificationRequiredToView: Forces signers to verify a text message prior to viewing the document. You must specify the phone number of signers to have this setting apply to them.
/// - templateId: When a signature request is created from a template this field will indicate the id of that template.
/// - externalSystemName: Used as an optional system name to appear in the signature log next to the signers who have been assigned an `embed_url_external_id`
/// - type: object type
/// - sourceFiles: List of files to create a signing document from. This is currently limited to ten files. Only the ID and type fields are required for each file.
/// - signers: Array of signers for the signature request.
Expand All @@ -84,7 +85,7 @@ public class SignRequest: SignRequestBase {
/// and can be downloaded at any point in the signing process.
/// - autoExpireAt: Uses `days_valid` to calculate the date and time, in GMT, the sign request will expire if unsigned.
/// - parentFolder:
public init(isDocumentPreparationNeeded: Bool? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, areTextSignaturesEnabled: Bool? = nil, emailSubject: String? = nil, emailMessage: String? = nil, areRemindersEnabled: Bool? = nil, name: String? = nil, prefillTags: [SignRequestPrefillTag]? = nil, daysValid: Int64? = nil, externalId: String? = nil, isPhoneVerificationRequiredToView: Bool? = nil, templateId: String? = nil, type: SignRequestTypeField? = nil, sourceFiles: [FileBase]? = nil, signers: [SignRequestSigner]? = nil, signatureColor: String? = nil, id: String? = nil, prepareUrl: String? = nil, signingLog: FileMini? = nil, status: SignRequestStatusField? = nil, signFiles: SignRequestSignFilesField? = nil, autoExpireAt: Date? = nil, parentFolder: FolderMini? = nil) {
public init(isDocumentPreparationNeeded: Bool? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, areTextSignaturesEnabled: Bool? = nil, emailSubject: String? = nil, emailMessage: String? = nil, areRemindersEnabled: Bool? = nil, name: String? = nil, prefillTags: [SignRequestPrefillTag]? = nil, daysValid: Int64? = nil, externalId: String? = nil, isPhoneVerificationRequiredToView: Bool? = nil, templateId: String? = nil, externalSystemName: String? = nil, type: SignRequestTypeField? = nil, sourceFiles: [FileBase]? = nil, signers: [SignRequestSigner]? = nil, signatureColor: String? = nil, id: String? = nil, prepareUrl: String? = nil, signingLog: FileMini? = nil, status: SignRequestStatusField? = nil, signFiles: SignRequestSignFilesField? = nil, autoExpireAt: Date? = nil, parentFolder: FolderMini? = nil) {
self.type = type
self.sourceFiles = sourceFiles
self.signers = signers
Expand All @@ -97,7 +98,7 @@ public class SignRequest: SignRequestBase {
self.autoExpireAt = autoExpireAt
self.parentFolder = parentFolder

super.init(isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId)
super.init(isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId, externalSystemName: externalSystemName)
}

required public init(from decoder: Decoder) throws {
Expand Down
10 changes: 9 additions & 1 deletion Sources/Schemas/SignRequestBase/SignRequestBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SignRequestBase: Codable {
case externalId = "external_id"
case isPhoneVerificationRequiredToView = "is_phone_verification_required_to_view"
case templateId = "template_id"
case externalSystemName = "external_system_name"
}

/// Indicates if the sender should receive a `prepare_url` in the response to complete document preparation using the UI.
Expand Down Expand Up @@ -57,6 +58,9 @@ public class SignRequestBase: Codable {
/// When a signature request is created from a template this field will indicate the id of that template.
public let templateId: String?

/// Used as an optional system name to appear in the signature log next to the signers who have been assigned an `embed_url_external_id`
public let externalSystemName: String?

/// Initializer for a SignRequestBase.
///
/// - Parameters:
Expand All @@ -73,7 +77,8 @@ public class SignRequestBase: Codable {
/// - externalId: This can be used to reference an ID in an external system that the sign request is related to.
/// - isPhoneVerificationRequiredToView: Forces signers to verify a text message prior to viewing the document. You must specify the phone number of signers to have this setting apply to them.
/// - templateId: When a signature request is created from a template this field will indicate the id of that template.
public init(isDocumentPreparationNeeded: Bool? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, areTextSignaturesEnabled: Bool? = nil, emailSubject: String? = nil, emailMessage: String? = nil, areRemindersEnabled: Bool? = nil, name: String? = nil, prefillTags: [SignRequestPrefillTag]? = nil, daysValid: Int64? = nil, externalId: String? = nil, isPhoneVerificationRequiredToView: Bool? = nil, templateId: String? = nil) {
/// - externalSystemName: Used as an optional system name to appear in the signature log next to the signers who have been assigned an `embed_url_external_id`
public init(isDocumentPreparationNeeded: Bool? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, areTextSignaturesEnabled: Bool? = nil, emailSubject: String? = nil, emailMessage: String? = nil, areRemindersEnabled: Bool? = nil, name: String? = nil, prefillTags: [SignRequestPrefillTag]? = nil, daysValid: Int64? = nil, externalId: String? = nil, isPhoneVerificationRequiredToView: Bool? = nil, templateId: String? = nil, externalSystemName: String? = nil) {
self.isDocumentPreparationNeeded = isDocumentPreparationNeeded
self.redirectUrl = redirectUrl
self.declinedRedirectUrl = declinedRedirectUrl
Expand All @@ -87,6 +92,7 @@ public class SignRequestBase: Codable {
self.externalId = externalId
self.isPhoneVerificationRequiredToView = isPhoneVerificationRequiredToView
self.templateId = templateId
self.externalSystemName = externalSystemName
}

required public init(from decoder: Decoder) throws {
Expand All @@ -104,6 +110,7 @@ public class SignRequestBase: Codable {
externalId = try container.decodeIfPresent(String.self, forKey: .externalId)
isPhoneVerificationRequiredToView = try container.decodeIfPresent(Bool.self, forKey: .isPhoneVerificationRequiredToView)
templateId = try container.decodeIfPresent(String.self, forKey: .templateId)
externalSystemName = try container.decodeIfPresent(String.self, forKey: .externalSystemName)
}

public func encode(to encoder: Encoder) throws {
Expand All @@ -121,6 +128,7 @@ public class SignRequestBase: Codable {
try container.encodeIfPresent(externalId, forKey: .externalId)
try container.encodeIfPresent(isPhoneVerificationRequiredToView, forKey: .isPhoneVerificationRequiredToView)
try container.encodeIfPresent(templateId, forKey: .templateId)
try container.encodeIfPresent(externalSystemName, forKey: .externalSystemName)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ public class SignRequestCreateRequest: SignRequestBase {
/// - externalId: This can be used to reference an ID in an external system that the sign request is related to.
/// - isPhoneVerificationRequiredToView: Forces signers to verify a text message prior to viewing the document. You must specify the phone number of signers to have this setting apply to them.
/// - templateId: When a signature request is created from a template this field will indicate the id of that template.
/// - externalSystemName: Used as an optional system name to appear in the signature log next to the signers who have been assigned an `embed_url_external_id`
/// - sourceFiles: List of files to create a signing document from. This is currently limited to ten files. Only the ID and type fields are required for each file.
/// - signatureColor: Force a specific color for the signature (blue, black, or red)
/// - parentFolder:
public init(signers: [SignRequestCreateSigner], isDocumentPreparationNeeded: Bool? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, areTextSignaturesEnabled: Bool? = nil, emailSubject: String? = nil, emailMessage: String? = nil, areRemindersEnabled: Bool? = nil, name: String? = nil, prefillTags: [SignRequestPrefillTag]? = nil, daysValid: Int64? = nil, externalId: String? = nil, isPhoneVerificationRequiredToView: Bool? = nil, templateId: String? = nil, sourceFiles: [FileBase]? = nil, signatureColor: SignRequestCreateRequestSignatureColorField? = nil, parentFolder: FolderMini? = nil) {
public init(signers: [SignRequestCreateSigner], isDocumentPreparationNeeded: Bool? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, areTextSignaturesEnabled: Bool? = nil, emailSubject: String? = nil, emailMessage: String? = nil, areRemindersEnabled: Bool? = nil, name: String? = nil, prefillTags: [SignRequestPrefillTag]? = nil, daysValid: Int64? = nil, externalId: String? = nil, isPhoneVerificationRequiredToView: Bool? = nil, templateId: String? = nil, externalSystemName: String? = nil, sourceFiles: [FileBase]? = nil, signatureColor: SignRequestCreateRequestSignatureColorField? = nil, parentFolder: FolderMini? = nil) {
self.signers = signers
self.sourceFiles = sourceFiles
self.signatureColor = signatureColor
self.parentFolder = parentFolder

super.init(isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId)
super.init(isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId, externalSystemName: externalSystemName)
}

required public init(from decoder: Decoder) throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class SignRequestCreateSigner: Codable {
case verificationPhoneNumber = "verification_phone_number"
case password
case signerGroupId = "signer_group_id"
case suppressNotifications = "suppress_notifications"
}

/// Email address of the signer.
Expand Down Expand Up @@ -75,6 +76,9 @@ public class SignRequestCreateSigner: Codable {
/// instead for signers in the same signer group.
public let signerGroupId: String?

/// If true, no emails about the sign request will be sent
public let suppressNotifications: Bool?

/// Initializer for a SignRequestCreateSigner.
///
/// - Parameters:
Expand Down Expand Up @@ -114,7 +118,8 @@ public class SignRequestCreateSigner: Codable {
/// as it was intended for an individual signer. The value provided can be any string and only used to
/// determine which signers belongs to same group. A successful response will provide a generated UUID value
/// instead for signers in the same signer group.
public init(email: String? = nil, role: SignRequestCreateSignerRoleField? = nil, isInPerson: Bool? = nil, order: Int64? = nil, embedUrlExternalUserId: String? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, loginRequired: Bool? = nil, verificationPhoneNumber: String? = nil, password: String? = nil, signerGroupId: String? = nil) {
/// - suppressNotifications: If true, no emails about the sign request will be sent
public init(email: String? = nil, role: SignRequestCreateSignerRoleField? = nil, isInPerson: Bool? = nil, order: Int64? = nil, embedUrlExternalUserId: String? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, loginRequired: Bool? = nil, verificationPhoneNumber: String? = nil, password: String? = nil, signerGroupId: String? = nil, suppressNotifications: Bool? = nil) {
self.email = email
self.role = role
self.isInPerson = isInPerson
Expand All @@ -126,6 +131,7 @@ public class SignRequestCreateSigner: Codable {
self.verificationPhoneNumber = verificationPhoneNumber
self.password = password
self.signerGroupId = signerGroupId
self.suppressNotifications = suppressNotifications
}

required public init(from decoder: Decoder) throws {
Expand All @@ -141,6 +147,7 @@ public class SignRequestCreateSigner: Codable {
verificationPhoneNumber = try container.decodeIfPresent(String.self, forKey: .verificationPhoneNumber)
password = try container.decodeIfPresent(String.self, forKey: .password)
signerGroupId = try container.decodeIfPresent(String.self, forKey: .signerGroupId)
suppressNotifications = try container.decodeIfPresent(Bool.self, forKey: .suppressNotifications)
}

public func encode(to encoder: Encoder) throws {
Expand All @@ -156,6 +163,7 @@ public class SignRequestCreateSigner: Codable {
try container.encodeIfPresent(verificationPhoneNumber, forKey: .verificationPhoneNumber)
try container.encodeIfPresent(password, forKey: .password)
try container.encodeIfPresent(signerGroupId, forKey: .signerGroupId)
try container.encodeIfPresent(suppressNotifications, forKey: .suppressNotifications)
}

}
5 changes: 3 additions & 2 deletions Sources/Schemas/SignRequestSigner/SignRequestSigner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class SignRequestSigner: SignRequestCreateSigner {
/// as it was intended for an individual signer. The value provided can be any string and only used to
/// determine which signers belongs to same group. A successful response will provide a generated UUID value
/// instead for signers in the same signer group.
/// - suppressNotifications: If true, no emails about the sign request will be sent
/// - hasViewedDocument: Set to `true` if the signer views the document
/// - signerDecision: Final decision made by the signer.
/// - inputs:
Expand All @@ -79,14 +80,14 @@ public class SignRequestSigner: SignRequestCreateSigner {
/// only if the `embed_url_external_user_id`
/// parameter was passed in the
/// `create Box Sign request` call.
public init(email: String? = nil, role: SignRequestCreateSignerRoleField? = nil, isInPerson: Bool? = nil, order: Int64? = nil, embedUrlExternalUserId: String? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, loginRequired: Bool? = nil, verificationPhoneNumber: String? = nil, password: String? = nil, signerGroupId: String? = nil, hasViewedDocument: Bool? = nil, signerDecision: SignRequestSignerSignerDecisionField? = nil, inputs: [SignRequestSignerInput]? = nil, embedUrl: String? = nil, iframeableEmbedUrl: String? = nil) {
public init(email: String? = nil, role: SignRequestCreateSignerRoleField? = nil, isInPerson: Bool? = nil, order: Int64? = nil, embedUrlExternalUserId: String? = nil, redirectUrl: String? = nil, declinedRedirectUrl: String? = nil, loginRequired: Bool? = nil, verificationPhoneNumber: String? = nil, password: String? = nil, signerGroupId: String? = nil, suppressNotifications: Bool? = nil, hasViewedDocument: Bool? = nil, signerDecision: SignRequestSignerSignerDecisionField? = nil, inputs: [SignRequestSignerInput]? = nil, embedUrl: String? = nil, iframeableEmbedUrl: String? = nil) {
self.hasViewedDocument = hasViewedDocument
self.signerDecision = signerDecision
self.inputs = inputs
self.embedUrl = embedUrl
self.iframeableEmbedUrl = iframeableEmbedUrl

super.init(email: email, role: role, isInPerson: isInPerson, order: order, embedUrlExternalUserId: embedUrlExternalUserId, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, loginRequired: loginRequired, verificationPhoneNumber: verificationPhoneNumber, password: password, signerGroupId: signerGroupId)
super.init(email: email, role: role, isInPerson: isInPerson, order: order, embedUrlExternalUserId: embedUrlExternalUserId, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, loginRequired: loginRequired, verificationPhoneNumber: verificationPhoneNumber, password: password, signerGroupId: signerGroupId, suppressNotifications: suppressNotifications)
}

required public init(from decoder: Decoder) throws {
Expand Down

0 comments on commit 069be60

Please sign in to comment.