diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5e5d5ceb --- /dev/null +++ b/.gitignore @@ -0,0 +1,63 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..da8af5b6 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,443 @@ +.gitignore +.openapi-generator-ignore +Cartfile +Package.swift +README.md +docs/AbstractWebhookPayload.md +docs/AliasControllerAPI.md +docs/AliasDto.md +docs/AliasProjection.md +docs/ApiUserControllerAPI.md +docs/AttachmentControllerAPI.md +docs/AttachmentEntity.md +docs/AttachmentMetaData.md +docs/AttachmentProjection.md +docs/BasicAuthOptions.md +docs/BounceControllerAPI.md +docs/BounceProjection.md +docs/BounceRecipientProjection.md +docs/BouncedEmailDto.md +docs/BouncedRecipientDto.md +docs/BulkActionsControllerAPI.md +docs/BulkSendEmailOptions.md +docs/CommonActionsControllerAPI.md +docs/Complaint.md +docs/ConditionOption.md +docs/ContactControllerAPI.md +docs/ContactDto.md +docs/ContactProjection.md +docs/ContentMatchOptions.md +docs/CountDto.md +docs/CreateAliasOptions.md +docs/CreateContactOptions.md +docs/CreateDomainOptions.md +docs/CreateEmergencyAddressOptions.md +docs/CreateGroupOptions.md +docs/CreateInboxDto.md +docs/CreateInboxForwarderOptions.md +docs/CreateInboxRulesetOptions.md +docs/CreateTemplateOptions.md +docs/CreateTrackingPixelOptions.md +docs/CreateWebhookOptions.md +docs/DNSLookupOptions.md +docs/DNSLookupResult.md +docs/DNSLookupResults.md +docs/DeliveryStatusDto.md +docs/DescribeDomainOptions.md +docs/DescribeMailServerDomainResult.md +docs/DomainControllerAPI.md +docs/DomainDto.md +docs/DomainNameRecord.md +docs/DomainPreview.md +docs/DownloadAttachmentDto.md +docs/Email.md +docs/EmailAnalysis.md +docs/EmailContentMatchResult.md +docs/EmailControllerAPI.md +docs/EmailHtmlDto.md +docs/EmailLinksResult.md +docs/EmailPreview.md +docs/EmailPreviewUrls.md +docs/EmailProjection.md +docs/EmailRecipients.md +docs/EmailTextLinesResult.md +docs/EmailValidationRequest.md +docs/EmailVerificationControllerAPI.md +docs/EmailVerificationResult.md +docs/EmergencyAddress.md +docs/EmergencyAddressDto.md +docs/EmptyResponseDto.md +docs/ExpirationDefaults.md +docs/ExpiredControllerAPI.md +docs/ExpiredInboxDto.md +docs/ExpiredInboxRecordProjection.md +docs/ExportControllerAPI.md +docs/ExportLink.md +docs/ExportOptions.md +docs/FilterBouncedRecipientsOptions.md +docs/FilterBouncedRecipientsResult.md +docs/FlushExpiredInboxesResult.md +docs/FormControllerAPI.md +docs/ForwardEmailOptions.md +docs/GravatarUrl.md +docs/GroupContactsDto.md +docs/GroupControllerAPI.md +docs/GroupDto.md +docs/GroupProjection.md +docs/HTMLValidationResult.md +docs/IPAddressResult.md +docs/ImapFlagOperationOptions.md +docs/ImapSmtpAccessDetails.md +docs/InboxByEmailAddressResult.md +docs/InboxByNameResult.md +docs/InboxControllerAPI.md +docs/InboxDto.md +docs/InboxExistsDto.md +docs/InboxForwarderControllerAPI.md +docs/InboxForwarderDto.md +docs/InboxForwarderTestOptions.md +docs/InboxForwarderTestResult.md +docs/InboxIdItem.md +docs/InboxIdsResult.md +docs/InboxPreview.md +docs/InboxRulesetControllerAPI.md +docs/InboxRulesetDto.md +docs/InboxRulesetTestOptions.md +docs/InboxRulesetTestResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/JSONSchemaDto.md +docs/MailServerControllerAPI.md +docs/MatchOption.md +docs/MatchOptions.md +docs/MissedEmail.md +docs/MissedEmailControllerAPI.md +docs/MissedEmailProjection.md +docs/NameServerRecord.md +docs/OrganizationInboxProjection.md +docs/PageAlias.md +docs/PageAttachmentEntity.md +docs/PageBouncedEmail.md +docs/PageBouncedRecipients.md +docs/PageComplaint.md +docs/PageContactProjection.md +docs/PageDeliveryStatus.md +docs/PageEmailPreview.md +docs/PageEmailProjection.md +docs/PageEmailValidationRequest.md +docs/PageExpiredInboxRecordProjection.md +docs/PageGroupProjection.md +docs/PageInboxForwarderDto.md +docs/PageInboxProjection.md +docs/PageInboxRulesetDto.md +docs/PageMissedEmailProjection.md +docs/PageOrganizationInboxProjection.md +docs/PagePhoneNumberProjection.md +docs/PageSentEmailProjection.md +docs/PageSentEmailWithQueueProjection.md +docs/PageSmsProjection.md +docs/PageTemplateProjection.md +docs/PageThreadProjection.md +docs/PageTrackingPixelProjection.md +docs/PageUnknownMissedEmailProjection.md +docs/PageWebhookProjection.md +docs/PageWebhookResult.md +docs/PageableObject.md +docs/PhoneControllerAPI.md +docs/PhoneNumberDto.md +docs/PhoneNumberProjection.md +docs/PhonePlanDto.md +docs/RawEmailJson.md +docs/Recipient.md +docs/ReplyToAliasEmailOptions.md +docs/ReplyToEmailOptions.md +docs/SendEmailOptions.md +docs/SendSMTPEnvelopeOptions.md +docs/SendWithQueueResult.md +docs/Sender.md +docs/SentEmailDto.md +docs/SentEmailProjection.md +docs/SentEmailsControllerAPI.md +docs/SetInboxFavouritedOptions.md +docs/SimpleSendEmailOptions.md +docs/SmsControllerAPI.md +docs/SmsDto.md +docs/SmsMatchOption.md +docs/SmsPreview.md +docs/SmsProjection.md +docs/Sort.md +docs/TemplateControllerAPI.md +docs/TemplateDto.md +docs/TemplatePreview.md +docs/TemplateProjection.md +docs/TemplateVariable.md +docs/TestNewInboxForwarderOptions.md +docs/TestNewInboxRulesetOptions.md +docs/TestPhoneNumberOptions.md +docs/ThreadProjection.md +docs/TrackingControllerAPI.md +docs/TrackingPixelDto.md +docs/TrackingPixelProjection.md +docs/UnknownMissedEmailProjection.md +docs/UnreadCount.md +docs/UnseenErrorCountDto.md +docs/UpdateAliasOptions.md +docs/UpdateDomainOptions.md +docs/UpdateGroupContacts.md +docs/UpdateInboxOptions.md +docs/UploadAttachmentOptions.md +docs/UserInfoDto.md +docs/ValidateEmailAddressListOptions.md +docs/ValidateEmailAddressListResult.md +docs/ValidationDto.md +docs/ValidationMessage.md +docs/VerifyEmailAddressOptions.md +docs/VerifyWebhookSignatureOptions.md +docs/VerifyWebhookSignatureResults.md +docs/WaitForConditions.md +docs/WaitForControllerAPI.md +docs/WaitForSingleSmsOptions.md +docs/WaitForSmsConditions.md +docs/WebhookBouncePayload.md +docs/WebhookBounceRecipientPayload.md +docs/WebhookControllerAPI.md +docs/WebhookDto.md +docs/WebhookEmailOpenedPayload.md +docs/WebhookEmailReadPayload.md +docs/WebhookHeaderNameValue.md +docs/WebhookHeaders.md +docs/WebhookNewAttachmentPayload.md +docs/WebhookNewContactPayload.md +docs/WebhookNewEmailPayload.md +docs/WebhookProjection.md +docs/WebhookRedriveResult.md +docs/WebhookResultDto.md +docs/WebhookTestRequest.md +docs/WebhookTestResponse.md +docs/WebhookTestResult.md +git_push.sh +mailslurp.podspec +mailslurp/APIHelper.swift +mailslurp/APIs.swift +mailslurp/APIs/AliasControllerAPI.swift +mailslurp/APIs/ApiUserControllerAPI.swift +mailslurp/APIs/AttachmentControllerAPI.swift +mailslurp/APIs/BounceControllerAPI.swift +mailslurp/APIs/BulkActionsControllerAPI.swift +mailslurp/APIs/CommonActionsControllerAPI.swift +mailslurp/APIs/ContactControllerAPI.swift +mailslurp/APIs/DomainControllerAPI.swift +mailslurp/APIs/EmailControllerAPI.swift +mailslurp/APIs/EmailVerificationControllerAPI.swift +mailslurp/APIs/ExpiredControllerAPI.swift +mailslurp/APIs/ExportControllerAPI.swift +mailslurp/APIs/FormControllerAPI.swift +mailslurp/APIs/GroupControllerAPI.swift +mailslurp/APIs/InboxControllerAPI.swift +mailslurp/APIs/InboxForwarderControllerAPI.swift +mailslurp/APIs/InboxRulesetControllerAPI.swift +mailslurp/APIs/MailServerControllerAPI.swift +mailslurp/APIs/MissedEmailControllerAPI.swift +mailslurp/APIs/PhoneControllerAPI.swift +mailslurp/APIs/SentEmailsControllerAPI.swift +mailslurp/APIs/SmsControllerAPI.swift +mailslurp/APIs/TemplateControllerAPI.swift +mailslurp/APIs/TrackingControllerAPI.swift +mailslurp/APIs/WaitForControllerAPI.swift +mailslurp/APIs/WebhookControllerAPI.swift +mailslurp/CodableHelper.swift +mailslurp/Configuration.swift +mailslurp/Extensions.swift +mailslurp/JSONDataEncoding.swift +mailslurp/JSONEncodingHelper.swift +mailslurp/Models.swift +mailslurp/Models/AbstractWebhookPayload.swift +mailslurp/Models/AliasDto.swift +mailslurp/Models/AliasProjection.swift +mailslurp/Models/AttachmentEntity.swift +mailslurp/Models/AttachmentMetaData.swift +mailslurp/Models/AttachmentProjection.swift +mailslurp/Models/BasicAuthOptions.swift +mailslurp/Models/BounceProjection.swift +mailslurp/Models/BounceRecipientProjection.swift +mailslurp/Models/BouncedEmailDto.swift +mailslurp/Models/BouncedRecipientDto.swift +mailslurp/Models/BulkSendEmailOptions.swift +mailslurp/Models/Complaint.swift +mailslurp/Models/ConditionOption.swift +mailslurp/Models/ContactDto.swift +mailslurp/Models/ContactProjection.swift +mailslurp/Models/ContentMatchOptions.swift +mailslurp/Models/CountDto.swift +mailslurp/Models/CreateAliasOptions.swift +mailslurp/Models/CreateContactOptions.swift +mailslurp/Models/CreateDomainOptions.swift +mailslurp/Models/CreateEmergencyAddressOptions.swift +mailslurp/Models/CreateGroupOptions.swift +mailslurp/Models/CreateInboxDto.swift +mailslurp/Models/CreateInboxForwarderOptions.swift +mailslurp/Models/CreateInboxRulesetOptions.swift +mailslurp/Models/CreateTemplateOptions.swift +mailslurp/Models/CreateTrackingPixelOptions.swift +mailslurp/Models/CreateWebhookOptions.swift +mailslurp/Models/DNSLookupOptions.swift +mailslurp/Models/DNSLookupResult.swift +mailslurp/Models/DNSLookupResults.swift +mailslurp/Models/DeliveryStatusDto.swift +mailslurp/Models/DescribeDomainOptions.swift +mailslurp/Models/DescribeMailServerDomainResult.swift +mailslurp/Models/DomainDto.swift +mailslurp/Models/DomainNameRecord.swift +mailslurp/Models/DomainPreview.swift +mailslurp/Models/DownloadAttachmentDto.swift +mailslurp/Models/Email.swift +mailslurp/Models/EmailAnalysis.swift +mailslurp/Models/EmailContentMatchResult.swift +mailslurp/Models/EmailHtmlDto.swift +mailslurp/Models/EmailLinksResult.swift +mailslurp/Models/EmailPreview.swift +mailslurp/Models/EmailPreviewUrls.swift +mailslurp/Models/EmailProjection.swift +mailslurp/Models/EmailRecipients.swift +mailslurp/Models/EmailTextLinesResult.swift +mailslurp/Models/EmailValidationRequest.swift +mailslurp/Models/EmailVerificationResult.swift +mailslurp/Models/EmergencyAddress.swift +mailslurp/Models/EmergencyAddressDto.swift +mailslurp/Models/EmptyResponseDto.swift +mailslurp/Models/ExpirationDefaults.swift +mailslurp/Models/ExpiredInboxDto.swift +mailslurp/Models/ExpiredInboxRecordProjection.swift +mailslurp/Models/ExportLink.swift +mailslurp/Models/ExportOptions.swift +mailslurp/Models/FilterBouncedRecipientsOptions.swift +mailslurp/Models/FilterBouncedRecipientsResult.swift +mailslurp/Models/FlushExpiredInboxesResult.swift +mailslurp/Models/ForwardEmailOptions.swift +mailslurp/Models/GravatarUrl.swift +mailslurp/Models/GroupContactsDto.swift +mailslurp/Models/GroupDto.swift +mailslurp/Models/GroupProjection.swift +mailslurp/Models/HTMLValidationResult.swift +mailslurp/Models/IPAddressResult.swift +mailslurp/Models/ImapFlagOperationOptions.swift +mailslurp/Models/ImapSmtpAccessDetails.swift +mailslurp/Models/InboxByEmailAddressResult.swift +mailslurp/Models/InboxByNameResult.swift +mailslurp/Models/InboxDto.swift +mailslurp/Models/InboxExistsDto.swift +mailslurp/Models/InboxForwarderDto.swift +mailslurp/Models/InboxForwarderTestOptions.swift +mailslurp/Models/InboxForwarderTestResult.swift +mailslurp/Models/InboxIdItem.swift +mailslurp/Models/InboxIdsResult.swift +mailslurp/Models/InboxPreview.swift +mailslurp/Models/InboxRulesetDto.swift +mailslurp/Models/InboxRulesetTestOptions.swift +mailslurp/Models/InboxRulesetTestResult.swift +mailslurp/Models/InlineObject.swift +mailslurp/Models/InlineObject1.swift +mailslurp/Models/JSONSchemaDto.swift +mailslurp/Models/MatchOption.swift +mailslurp/Models/MatchOptions.swift +mailslurp/Models/MissedEmail.swift +mailslurp/Models/MissedEmailProjection.swift +mailslurp/Models/NameServerRecord.swift +mailslurp/Models/OrganizationInboxProjection.swift +mailslurp/Models/PageAlias.swift +mailslurp/Models/PageAttachmentEntity.swift +mailslurp/Models/PageBouncedEmail.swift +mailslurp/Models/PageBouncedRecipients.swift +mailslurp/Models/PageComplaint.swift +mailslurp/Models/PageContactProjection.swift +mailslurp/Models/PageDeliveryStatus.swift +mailslurp/Models/PageEmailPreview.swift +mailslurp/Models/PageEmailProjection.swift +mailslurp/Models/PageEmailValidationRequest.swift +mailslurp/Models/PageExpiredInboxRecordProjection.swift +mailslurp/Models/PageGroupProjection.swift +mailslurp/Models/PageInboxForwarderDto.swift +mailslurp/Models/PageInboxProjection.swift +mailslurp/Models/PageInboxRulesetDto.swift +mailslurp/Models/PageMissedEmailProjection.swift +mailslurp/Models/PageOrganizationInboxProjection.swift +mailslurp/Models/PagePhoneNumberProjection.swift +mailslurp/Models/PageSentEmailProjection.swift +mailslurp/Models/PageSentEmailWithQueueProjection.swift +mailslurp/Models/PageSmsProjection.swift +mailslurp/Models/PageTemplateProjection.swift +mailslurp/Models/PageThreadProjection.swift +mailslurp/Models/PageTrackingPixelProjection.swift +mailslurp/Models/PageUnknownMissedEmailProjection.swift +mailslurp/Models/PageWebhookProjection.swift +mailslurp/Models/PageWebhookResult.swift +mailslurp/Models/PageableObject.swift +mailslurp/Models/PhoneNumberDto.swift +mailslurp/Models/PhoneNumberProjection.swift +mailslurp/Models/PhonePlanDto.swift +mailslurp/Models/RawEmailJson.swift +mailslurp/Models/Recipient.swift +mailslurp/Models/ReplyToAliasEmailOptions.swift +mailslurp/Models/ReplyToEmailOptions.swift +mailslurp/Models/SendEmailOptions.swift +mailslurp/Models/SendSMTPEnvelopeOptions.swift +mailslurp/Models/SendWithQueueResult.swift +mailslurp/Models/Sender.swift +mailslurp/Models/SentEmailDto.swift +mailslurp/Models/SentEmailProjection.swift +mailslurp/Models/SetInboxFavouritedOptions.swift +mailslurp/Models/SimpleSendEmailOptions.swift +mailslurp/Models/SmsDto.swift +mailslurp/Models/SmsMatchOption.swift +mailslurp/Models/SmsPreview.swift +mailslurp/Models/SmsProjection.swift +mailslurp/Models/Sort.swift +mailslurp/Models/TemplateDto.swift +mailslurp/Models/TemplatePreview.swift +mailslurp/Models/TemplateProjection.swift +mailslurp/Models/TemplateVariable.swift +mailslurp/Models/TestNewInboxForwarderOptions.swift +mailslurp/Models/TestNewInboxRulesetOptions.swift +mailslurp/Models/TestPhoneNumberOptions.swift +mailslurp/Models/ThreadProjection.swift +mailslurp/Models/TrackingPixelDto.swift +mailslurp/Models/TrackingPixelProjection.swift +mailslurp/Models/UnknownMissedEmailProjection.swift +mailslurp/Models/UnreadCount.swift +mailslurp/Models/UnseenErrorCountDto.swift +mailslurp/Models/UpdateAliasOptions.swift +mailslurp/Models/UpdateDomainOptions.swift +mailslurp/Models/UpdateGroupContacts.swift +mailslurp/Models/UpdateInboxOptions.swift +mailslurp/Models/UploadAttachmentOptions.swift +mailslurp/Models/UserInfoDto.swift +mailslurp/Models/ValidateEmailAddressListOptions.swift +mailslurp/Models/ValidateEmailAddressListResult.swift +mailslurp/Models/ValidationDto.swift +mailslurp/Models/ValidationMessage.swift +mailslurp/Models/VerifyEmailAddressOptions.swift +mailslurp/Models/VerifyWebhookSignatureOptions.swift +mailslurp/Models/VerifyWebhookSignatureResults.swift +mailslurp/Models/WaitForConditions.swift +mailslurp/Models/WaitForSingleSmsOptions.swift +mailslurp/Models/WaitForSmsConditions.swift +mailslurp/Models/WebhookBouncePayload.swift +mailslurp/Models/WebhookBounceRecipientPayload.swift +mailslurp/Models/WebhookDto.swift +mailslurp/Models/WebhookEmailOpenedPayload.swift +mailslurp/Models/WebhookEmailReadPayload.swift +mailslurp/Models/WebhookHeaderNameValue.swift +mailslurp/Models/WebhookHeaders.swift +mailslurp/Models/WebhookNewAttachmentPayload.swift +mailslurp/Models/WebhookNewContactPayload.swift +mailslurp/Models/WebhookNewEmailPayload.swift +mailslurp/Models/WebhookProjection.swift +mailslurp/Models/WebhookRedriveResult.swift +mailslurp/Models/WebhookResultDto.swift +mailslurp/Models/WebhookTestRequest.swift +mailslurp/Models/WebhookTestResponse.swift +mailslurp/Models/WebhookTestResult.swift +mailslurp/OpenISO8601DateFormatter.swift +mailslurp/SynchronizedDictionary.swift +mailslurp/URLSessionImplementations.swift +project.yml diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..3bff0591 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.1 \ No newline at end of file diff --git a/Cartfile b/Cartfile new file mode 100644 index 00000000..84476a72 --- /dev/null +++ b/Cartfile @@ -0,0 +1,3 @@ + +github "mxcl/PromiseKit" ~> 6.13.1 +github "Flight-School/AnyCodable" ~> 0.4.0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..c808260a --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2022 MailSlurp Email API (Provided by Pettman OÜ, Estonia) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 00000000..9cd1b5ff --- /dev/null +++ b/Package.resolved @@ -0,0 +1,25 @@ +{ + "object": { + "pins": [ + { + "package": "AnyCodable", + "repositoryURL": "https://github.com/Flight-School/AnyCodable", + "state": { + "branch": null, + "revision": "38b05fc9f86501ef8018aa90cf3d83bd97f74067", + "version": "0.4.0" + } + }, + { + "package": "PromiseKit", + "repositoryURL": "https://github.com/mxcl/PromiseKit.git", + "state": { + "branch": null, + "revision": "ed3192004c0b00b4b3d7baa9578ee655c66faae3", + "version": "6.18.0" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..5fbdc5c0 --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.1 + +import PackageDescription + +let package = Package( + name: "mailslurp", + platforms: [ + .iOS(.v9), + .macOS(.v10_11), + .tvOS(.v9), + .watchOS(.v3), + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "mailslurp", + targets: ["mailslurp"] + ), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + .package(url: "https://github.com/Flight-School/AnyCodable", .exact("0.4.0")), + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "mailslurp", + dependencies: ["AnyCodable", "PromiseKit", ], + path: "mailslurp" + ), + ] +) diff --git a/README.md b/README.md new file mode 100644 index 00000000..4a3f33b6 --- /dev/null +++ b/README.md @@ -0,0 +1,179 @@ +# MailSlurp Swift Email Client + +Send and receive emails in Swift and Objective C. Use the MailSlurp Swift client for managing email accounts in iOS, MacOS, TVOS, and more. Built with OpenAPI and PromiseKit. + +## Quick links + +- [Swift getting started guide](https://www.mailslurp.com/examples/) +- [SwiftPackageIndex](https://swiftpackageindex.com/mailslurp/mailslurp-client-swift) +- [Github Source](https://github.com/mailslurp/mailslurp-client-swift/) +- [Method Documentation](https://docs.mailslurp.com/swift/docs/) +- [iOS XCode setup example](https://www.mailslurp.com/examples/ios-xcode-send-and-read-email-example/) +- [Support](https://www.mailslurp.com/support/) + +## Install MailSlurp package +The Swift package is hosted on the [Swift Package Index](https://swiftpackageindex.com/mailslurp/mailslurp-client-swift) and [GitHub](https://github.com/mailslurp/mailslurp-client-swift). Create a new swift project using: + +```bash +swift package init --type=executable +``` + +Edit `Packages.swift` and add `https://github.com/mailslurp/mailslurp-client-swift` as a package **and** a target dependency. + +```swift +// swift-tools-version:5.5 + +import PackageDescription + +let package = Package( + name: "your-project", + products: [ + ], + dependencies: [ + .package(url: "https://github.com/mailslurp/mailslurp-client-swift", from: "15.12.5"), + ], + targets: [ + .testTarget( + name: "your-test-project", + dependencies: [ + .product(name: "mailslurp", package: "mailslurp-client-swift") + ]), + ] +) +``` + +MailSlurp client is built with PromiseKit (async/await for swift) so you may also want to include [AwaitKit](https://github.com/yannickl/AwaitKit) in your swift dependencies for awaiting Promise results. + +## Setup API Key + +MailSlurp is free to use but requires an API Key. [Sign up](https://app.mailslurp.com) and create an API Key using the [MailSlurp dashboard](https://app.mailslurp.com). + +When you make requests use an API controller's `withRequestBuilder` method call the `addHeader("x-api-key", "your-api-key")` method to add authentication to your requests. For example when using the InboxController methods: + +```swift +let promise = InboxControllerAPI + .createInboxWithDefaultsWithRequestBuilder() + .addHeader(name: "x-api-key", value: apiKey) + .execute() +``` + +The full test example is as follows: + +```swift +let apiKey = ProcessInfo.processInfo.environment["API_KEY"] ?? "" +InboxControllerAPI.createInboxWithDefaultsWithRequestBuilder() + // use addHeader to add your api key to requests + .addHeader(name: "x-api-key", value: apiKey) + .execute() + // uses PromiseKit for response handling + .done { response in + XCTAssertTrue(response.body?.emailAddress?.contains("@mailslurp") ?? false) + XCTAssertTrue(response.statusCode == 201) + expectation.fulfill() + }.catch { errorType in + // handle error, cast to mailslurp.ErrorResponse using guard to access .error(statusCode, data, _, _) + } +``` + +## API structure + +The Swift client mimics the [controllers and methods of the REST API](https://docs.mailslurp.com/api/). For controller and method documentation please see the [code hosted on GitHub](https://github.com/mailslurp/mailslurp-client-swift) or read the [getting started guide](https://www.mailslurp.com/guides/getting-started/). + +## Platform compatibility + +MailSlurp Swift client is built to target Swift 5.x and XCode 12.x. + +| Platform | Minimum Version | +|----------|-----------------| +| iOS | v9 | +| MacOS | V10.11 | +| TVOS | v9 | +| WatchOS | v3 | + +## Example usage + +MailSlurp uses PromiseKit. To test using XCTest and MailSlurp use the example below: + +```swift +import XCTest +import class Foundation.Bundle +import mailslurp + +final class exampleTests: XCTestCase { + func testExample() throws { + let expectation = self.expectation(description: "Can create inbox") + let apiKey = ProcessInfo.processInfo.environment["API_KEY"] ?? "" + InboxControllerAPI.createInboxWithDefaultsWithRequestBuilder() + .addHeader(name: "x-api-key", value: apiKey) + .execute() + .done { response in + XCTAssertTrue(response.statusCode == 201) + XCTAssertTrue(response.body?.emailAddress?.contains("@mailslurp") ?? false) + expectation.fulfill() + }.catch { errorType in + XCTAssertFalse(true, "Should not throw exception") + } + waitForExpectations(timeout: 5, handler: nil) + + } + + /// Returns path to the built products directory. + var productsDirectory: URL { + #if os(macOS) + for bundle in Bundle.allBundles where bundle.bundlePath.hasSuffix(".xctest") { + return bundle.bundleURL.deletingLastPathComponent() + } + fatalError("couldn't find the products directory") + #else + return Bundle.main.bundleURL + #endif + } +} +``` + +To run the test execute: + +```bash +API_KEY=your-api-key swift test +``` + +### Handling exceptions + +Use a guard to cast errors to a `mailslurp.ErrorResponse` to access the status code and error message of a request. + +```swift +CommonActionsControllerAPI.sendEmailSimpleWithRequestBuilder(emailOptions: sendOptions) + .addHeader(name: "x-api-key", value: apiKey) + .execute() + .done { response in + // handle success + } + .catch(policy: .allErrors) { err in + // handle error + guard let e = err as? mailslurp.ErrorResponse else { + error = err.localizedDescription + return + } + // pattern match the error to access status code and data + // MailSlurp returns 4xx errors when invalid parameters or + // unsatisfiable request. See the message and status code + switch e { + case .error(let statusCode, let data, _, _): + let msg = String(decoding: data!, as: UTF8.self) + error = "\(statusCode) Bad request: \(msg)" + } + } +``` + +### Awaiting promises + +PromiseKit wraps MailSlurp request results in a Promise. Use `.done { response in }` and `.catch { err in }` methods to handle responses and exceptions. For easier access use AwaitKit style await functions. + +```swift +let inbox = try! await( + InboxControllerAPI.createInboxWithDefaultsWithRequestBuilder() + .addHeader(name: "x-api-key", value: apiKey) + .execute() +) +// then access inbox.emailAddress, inbox.id etc +``` diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..dc36834d --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,4 @@ +# Security + +This client calls the MailSlurp API endpoints. Connections should be made over secure HTTPS using your secure API Token. Do not share or commit the token if you can avoid doing so. +To report security issues or talk with MailSlurp support please email [support@mailslurp.zendesk.com](mailto:support@mailslurp.zendesk.com). diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 00000000..96f6bd0f --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,4 @@ +# Support + +To report issues or talk with MailSlurp support please email [support@mailslurp.zendesk.com](mailto:support@mailslurp.zendesk.com). +Alternatively you can visit our [support portal](https://mailslurp.zendesk.com) or open a ticket in the corresponding [Github repository](https://www.github.com/mailslurp). diff --git a/docs/AbstractWebhookPayload.md b/docs/AbstractWebhookPayload.md new file mode 100644 index 00000000..a9977944 --- /dev/null +++ b/docs/AbstractWebhookPayload.md @@ -0,0 +1,13 @@ +# AbstractWebhookPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**eventName** | **String** | | +**messageId** | **String** | | +**webhookId** | **UUID** | | +**webhookName** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/AliasControllerAPI.md b/docs/AliasControllerAPI.md new file mode 100644 index 00000000..756218f1 --- /dev/null +++ b/docs/AliasControllerAPI.md @@ -0,0 +1,472 @@ +# AliasControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createAlias**](AliasControllerAPI#createalias) | **POST** /aliases | Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. +[**deleteAlias**](AliasControllerAPI#deletealias) | **DELETE** /aliases/{aliasId} | Delete an email alias +[**getAlias**](AliasControllerAPI#getalias) | **GET** /aliases/{aliasId} | Get an email alias +[**getAliasEmails**](AliasControllerAPI#getaliasemails) | **GET** /aliases/{aliasId}/emails | Get emails for an alias +[**getAliasThreads**](AliasControllerAPI#getaliasthreads) | **GET** /aliases/{aliasId}/threads | Get threads created for an alias +[**getAliases**](AliasControllerAPI#getaliases) | **GET** /aliases | Get all email aliases you have created +[**replyToAliasEmail**](AliasControllerAPI#replytoaliasemail) | **PUT** /aliases/{aliasId}/emails/{emailId} | Reply to an email +[**sendAliasEmail**](AliasControllerAPI#sendaliasemail) | **POST** /aliases/{aliasId}/emails | Send an email from an alias inbox +[**updateAlias**](AliasControllerAPI#updatealias) | **PUT** /aliases/{aliasId} | Update an email alias + + +# **createAlias** +```swift + open class func createAlias( createAliasOptions: CreateAliasOptions) -> Promise +``` + +Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. + +Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createAliasOptions = CreateAliasOptions(emailAddress: "emailAddress_example", inboxId: 123, name: "name_example", useThreads: false) // CreateAliasOptions | + +// Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. +AliasControllerAPI.createAlias(createAliasOptions: createAliasOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createAliasOptions** | [**CreateAliasOptions**](CreateAliasOptions) | | + +### Return type + +[**AliasDto**](AliasDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteAlias** +```swift + open class func deleteAlias( aliasId: UUID) -> Promise +``` + +Delete an email alias + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | + +// Delete an email alias +AliasControllerAPI.deleteAlias(aliasId: aliasId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAlias** +```swift + open class func getAlias( aliasId: UUID) -> Promise +``` + +Get an email alias + +Get an email alias by ID + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | + +// Get an email alias +AliasControllerAPI.getAlias(aliasId: aliasId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | | + +### Return type + +[**AliasDto**](AliasDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAliasEmails** +```swift + open class func getAliasEmails( aliasId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getAliasEmails? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get emails for an alias + +Get paginated emails for an alias by ID + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | +let page = 987 // Int | Optional page index alias email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size alias email list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Optional filter by sent after given date time (optional) +let before = Date() // Date | Optional filter by sent before given date time (optional) + +// Get emails for an alias +AliasControllerAPI.getAliasEmails(aliasId: aliasId, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | | + **page** | **Int** | Optional page index alias email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size alias email list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Optional filter by sent after given date time | [optional] + **before** | **Date** | Optional filter by sent before given date time | [optional] + +### Return type + +[**PageEmailProjection**](PageEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAliasThreads** +```swift + open class func getAliasThreads( aliasId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getAliasThreads? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get threads created for an alias + +Returns threads created for an email alias in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | +let page = 987 // Int | Optional page index in thread list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in thread list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Optional filter by sent after given date time (optional) +let before = Date() // Date | Optional filter by sent before given date time (optional) + +// Get threads created for an alias +AliasControllerAPI.getAliasThreads(aliasId: aliasId, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | | + **page** | **Int** | Optional page index in thread list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in thread list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Optional filter by sent after given date time | [optional] + **before** | **Date** | Optional filter by sent before given date time | [optional] + +### Return type + +[**PageThreadProjection**](PageThreadProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAliases** +```swift + open class func getAliases( page: Int? = nil, size: Int? = nil, sort: Sort_getAliases? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all email aliases you have created + +Get all email aliases in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in alias list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in alias list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get all email aliases you have created +AliasControllerAPI.getAliases(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in alias list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in alias list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageAlias**](PageAlias) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **replyToAliasEmail** +```swift + open class func replyToAliasEmail( aliasId: UUID, emailId: UUID, replyToAliasEmailOptions: ReplyToAliasEmailOptions) -> Promise +``` + +Reply to an email + +Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | ID of the alias that email belongs to +let emailId = 987 // UUID | ID of the email that should be replied to +let replyToAliasEmailOptions = ReplyToAliasEmailOptions(body: "body_example", isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, html: false) // ReplyToAliasEmailOptions | + +// Reply to an email +AliasControllerAPI.replyToAliasEmail(aliasId: aliasId, emailId: emailId, replyToAliasEmailOptions: replyToAliasEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | ID of the alias that email belongs to | + **emailId** | [**UUID**]() | ID of the email that should be replied to | + **replyToAliasEmailOptions** | [**ReplyToAliasEmailOptions**](ReplyToAliasEmailOptions) | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendAliasEmail** +```swift + open class func sendAliasEmail( aliasId: UUID, sendEmailOptions: SendEmailOptions) -> Promise +``` + +Send an email from an alias inbox + +Send an email from an alias. Replies to the email will be forwarded to the alias masked email address + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | +let sendEmailOptions = SendEmailOptions(toContacts: [123], toGroup: 123, to: ["to_example"], from: "from_example", cc: ["cc_example"], bcc: ["bcc_example"], subject: "subject_example", replyTo: "replyTo_example", body: "body_example", html: false, isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, addTrackingPixel: false, filterBouncedRecipients: false, validateEmailAddresses: "validateEmailAddresses_example") // SendEmailOptions | + +// Send an email from an alias inbox +AliasControllerAPI.sendAliasEmail(aliasId: aliasId, sendEmailOptions: sendEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | | + **sendEmailOptions** | [**SendEmailOptions**](SendEmailOptions) | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **updateAlias** +```swift + open class func updateAlias( aliasId: UUID, updateAliasOptions: UpdateAliasOptions) -> Promise +``` + +Update an email alias + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let aliasId = 987 // UUID | +let updateAliasOptions = UpdateAliasOptions(name: "name_example") // UpdateAliasOptions | + +// Update an email alias +AliasControllerAPI.updateAlias(aliasId: aliasId, updateAliasOptions: updateAliasOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aliasId** | [**UUID**]() | | + **updateAliasOptions** | [**UpdateAliasOptions**](UpdateAliasOptions) | | + +### Return type + +[**AliasDto**](AliasDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/AliasDto.md b/docs/AliasDto.md new file mode 100644 index 00000000..117e0b27 --- /dev/null +++ b/docs/AliasDto.md @@ -0,0 +1,19 @@ +# AliasDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**emailAddress** | **String** | The alias's email address for receiving email | +**maskedEmailAddress** | **String** | The underlying email address that is hidden and will received forwarded email | [optional] +**userId** | **UUID** | | +**inboxId** | **UUID** | Inbox that is associated with the alias | +**name** | **String** | | [optional] +**useThreads** | **Bool** | If alias will generate response threads or not when email are received by it | [optional] +**isVerified** | **Bool** | Has the alias been verified. You must verify an alias if the masked email address has not yet been verified by your account | +**createdAt** | **Date** | | [optional] +**updatedAt** | **Date** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/AliasProjection.md b/docs/AliasProjection.md new file mode 100644 index 00000000..3498c461 --- /dev/null +++ b/docs/AliasProjection.md @@ -0,0 +1,17 @@ +# AliasProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**_id** | **UUID** | | +**inboxId** | **UUID** | | +**userId** | **UUID** | | +**emailAddress** | **String** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | +**useThreads** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ApiUserControllerAPI.md b/docs/ApiUserControllerAPI.md new file mode 100644 index 00000000..f9203783 --- /dev/null +++ b/docs/ApiUserControllerAPI.md @@ -0,0 +1,131 @@ +# ApiUserControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getSmtpPassword**](ApiUserControllerAPI#getsmtppassword) | **GET** /user/smtp/password | +[**getSmtpUsername**](ApiUserControllerAPI#getsmtpusername) | **GET** /user/smtp/username | +[**getUserInfo**](ApiUserControllerAPI#getuserinfo) | **GET** /user/info | + + +# **getSmtpPassword** +```swift + open class func getSmtpPassword() -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +ApiUserControllerAPI.getSmtpPassword().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSmtpUsername** +```swift + open class func getSmtpUsername() -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +ApiUserControllerAPI.getSmtpUsername().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getUserInfo** +```swift + open class func getUserInfo() -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +ApiUserControllerAPI.getUserInfo().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserInfoDto**](UserInfoDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/AttachmentControllerAPI.md b/docs/AttachmentControllerAPI.md new file mode 100644 index 00000000..84e2bfa9 --- /dev/null +++ b/docs/AttachmentControllerAPI.md @@ -0,0 +1,492 @@ +# AttachmentControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteAllAttachments**](AttachmentControllerAPI#deleteallattachments) | **DELETE** /attachments | Delete all attachments +[**deleteAttachment**](AttachmentControllerAPI#deleteattachment) | **DELETE** /attachments/{attachmentId} | Delete an attachment +[**downloadAttachmentAsBase64Encoded**](AttachmentControllerAPI#downloadattachmentasbase64encoded) | **GET** /attachments/{attachmentId}/base64 | Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. +[**downloadAttachmentAsBytes**](AttachmentControllerAPI#downloadattachmentasbytes) | **GET** /attachments/{attachmentId}/bytes | Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. +[**getAttachment**](AttachmentControllerAPI#getattachment) | **GET** /attachments/{attachmentId} | Get an attachment entity +[**getAttachmentInfo**](AttachmentControllerAPI#getattachmentinfo) | **GET** /attachments/{attachmentId}/metadata | Get email attachment metadata information +[**getAttachments**](AttachmentControllerAPI#getattachments) | **GET** /attachments | Get email attachments +[**uploadAttachment**](AttachmentControllerAPI#uploadattachment) | **POST** /attachments | Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. +[**uploadAttachmentBytes**](AttachmentControllerAPI#uploadattachmentbytes) | **POST** /attachments/bytes | Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment. +[**uploadMultipartForm**](AttachmentControllerAPI#uploadmultipartform) | **POST** /attachments/multipart | Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. + + +# **deleteAllAttachments** +```swift + open class func deleteAllAttachments() -> Promise +``` + +Delete all attachments + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Delete all attachments +AttachmentControllerAPI.deleteAllAttachments().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteAttachment** +```swift + open class func deleteAttachment( attachmentId: String) -> Promise +``` + +Delete an attachment + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Delete an attachment +AttachmentControllerAPI.deleteAttachment(attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **attachmentId** | **String** | ID of attachment | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **downloadAttachmentAsBase64Encoded** +```swift + open class func downloadAttachmentAsBase64Encoded( attachmentId: String) -> Promise +``` + +Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. + +Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. +AttachmentControllerAPI.downloadAttachmentAsBase64Encoded(attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **attachmentId** | **String** | ID of attachment | + +### Return type + +[**DownloadAttachmentDto**](DownloadAttachmentDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **downloadAttachmentAsBytes** +```swift + open class func downloadAttachmentAsBytes( attachmentId: String) -> Promise +``` + +Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. + +Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. +AttachmentControllerAPI.downloadAttachmentAsBytes(attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **attachmentId** | **String** | ID of attachment | + +### Return type + +**Data** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAttachment** +```swift + open class func getAttachment( attachmentId: String) -> Promise +``` + +Get an attachment entity + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Get an attachment entity +AttachmentControllerAPI.getAttachment(attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **attachmentId** | **String** | ID of attachment | + +### Return type + +[**AttachmentEntity**](AttachmentEntity) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAttachmentInfo** +```swift + open class func getAttachmentInfo( attachmentId: String) -> Promise +``` + +Get email attachment metadata information + +Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Get email attachment metadata information +AttachmentControllerAPI.getAttachmentInfo(attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **attachmentId** | **String** | ID of attachment | + +### Return type + +[**AttachmentMetaData**](AttachmentMetaData) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAttachments** +```swift + open class func getAttachments( page: Int? = nil, size: Int? = nil, sort: Sort_getAttachments? = nil, fileNameFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get email attachments + +Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index for list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size for list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let fileNameFilter = "fileNameFilter_example" // String | Optional file name and content type search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get email attachments +AttachmentControllerAPI.getAttachments(page: page, size: size, sort: sort, fileNameFilter: fileNameFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index for list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size for list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **fileNameFilter** | **String** | Optional file name and content type search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageAttachmentEntity**](PageAttachmentEntity) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **uploadAttachment** +```swift + open class func uploadAttachment( uploadAttachmentOptions: UploadAttachmentOptions) -> Promise<[String]> +``` + +Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let uploadAttachmentOptions = UploadAttachmentOptions(contentType: "contentType_example", filename: "filename_example", base64Contents: "base64Contents_example") // UploadAttachmentOptions | + +// Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. +AttachmentControllerAPI.uploadAttachment(uploadAttachmentOptions: uploadAttachmentOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uploadAttachmentOptions** | [**UploadAttachmentOptions**](UploadAttachmentOptions) | | + +### Return type + +**[String]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **uploadAttachmentBytes** +```swift + open class func uploadAttachmentBytes( inlineObject1: InlineObject1, contentType: String? = nil, filename: String? = nil) -> Promise<[String]> +``` + +Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inlineObject1 = inline_object_1(short: 123, char: "char_example", int: 123, long: 123, float: 123, double: 123, direct: false, readOnly: false) // InlineObject1 | +let contentType = "contentType_example" // String | Optional contentType for file. For instance `application/pdf` (optional) +let filename = "filename_example" // String | Optional filename to save upload with (optional) + +// Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment. +AttachmentControllerAPI.uploadAttachmentBytes(inlineObject1: inlineObject1, contentType: contentType, filename: filename).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inlineObject1** | [**InlineObject1**](InlineObject1) | | + **contentType** | **String** | Optional contentType for file. For instance `application/pdf` | [optional] + **filename** | **String** | Optional filename to save upload with | [optional] + +### Return type + +**[String]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **uploadMultipartForm** +```swift + open class func uploadMultipartForm( contentType: String? = nil, filename: String? = nil, xFilename: String? = nil, inlineObject: InlineObject? = nil) -> Promise<[String]> +``` + +Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let contentType = "contentType_example" // String | Optional content type of attachment (optional) +let filename = "filename_example" // String | Optional name of file (optional) +let xFilename = "xFilename_example" // String | Optional content type header of attachment (optional) +let inlineObject = inline_object(contentTypeHeader: "contentTypeHeader_example", file: URL(string: "https://example.com")!) // InlineObject | (optional) + +// Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. +AttachmentControllerAPI.uploadMultipartForm(contentType: contentType, filename: filename, xFilename: xFilename, inlineObject: inlineObject).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **String** | Optional content type of attachment | [optional] + **filename** | **String** | Optional name of file | [optional] + **xFilename** | **String** | Optional content type header of attachment | [optional] + **inlineObject** | [**InlineObject**](InlineObject) | | [optional] + +### Return type + +**[String]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/AttachmentEntity.md b/docs/AttachmentEntity.md new file mode 100644 index 00000000..54e9076d --- /dev/null +++ b/docs/AttachmentEntity.md @@ -0,0 +1,18 @@ +# AttachmentEntity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**attachmentId** | **String** | | +**bucket** | **String** | | [optional] +**userId** | **UUID** | | +**contentType** | **String** | | [optional] +**contentLength** | **Int64** | | [optional] +**name** | **String** | | [optional] +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/AttachmentMetaData.md b/docs/AttachmentMetaData.md new file mode 100644 index 00000000..f1f83f8c --- /dev/null +++ b/docs/AttachmentMetaData.md @@ -0,0 +1,13 @@ +# AttachmentMetaData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of attachment if given | +**contentType** | **String** | Content type of attachment such as `image/png` | +**contentLength** | **Int64** | Size of attachment in bytes | +**_id** | **String** | ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/AttachmentProjection.md b/docs/AttachmentProjection.md new file mode 100644 index 00000000..79851c98 --- /dev/null +++ b/docs/AttachmentProjection.md @@ -0,0 +1,16 @@ +# AttachmentProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**contentLength** | **Int64** | Content length of attachment in bytes | [optional] +**contentType** | **String** | Content type of attachment. | [optional] +**userId** | **UUID** | | +**attachmentId** | **String** | Attachment ID | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/BasicAuthOptions.md b/docs/BasicAuthOptions.md new file mode 100644 index 00000000..ca3b0649 --- /dev/null +++ b/docs/BasicAuthOptions.md @@ -0,0 +1,11 @@ +# BasicAuthOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | +**password** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/BounceControllerAPI.md b/docs/BounceControllerAPI.md new file mode 100644 index 00000000..59ea07c5 --- /dev/null +++ b/docs/BounceControllerAPI.md @@ -0,0 +1,320 @@ +# BounceControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filterBouncedRecipient**](BounceControllerAPI#filterbouncedrecipient) | **POST** /bounce/filter-recipients | Filter a list of email recipients and remove those who have bounced +[**getBouncedEmail**](BounceControllerAPI#getbouncedemail) | **GET** /bounce/emails/{id} | Get a bounced email. +[**getBouncedEmails**](BounceControllerAPI#getbouncedemails) | **GET** /bounce/emails | Get paginated list of bounced emails. +[**getBouncedRecipient**](BounceControllerAPI#getbouncedrecipient) | **GET** /bounce/recipients/{id} | Get a bounced email. +[**getBouncedRecipients**](BounceControllerAPI#getbouncedrecipients) | **GET** /bounce/recipients | Get paginated list of bounced recipients. +[**getComplaints**](BounceControllerAPI#getcomplaints) | **GET** /bounce/complaints | Get paginated list of complaints. + + +# **filterBouncedRecipient** +```swift + open class func filterBouncedRecipient( filterBouncedRecipientsOptions: FilterBouncedRecipientsOptions) -> Promise +``` + +Filter a list of email recipients and remove those who have bounced + +Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let filterBouncedRecipientsOptions = FilterBouncedRecipientsOptions(emailRecipients: ["emailRecipients_example"]) // FilterBouncedRecipientsOptions | + +// Filter a list of email recipients and remove those who have bounced +BounceControllerAPI.filterBouncedRecipient(filterBouncedRecipientsOptions: filterBouncedRecipientsOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filterBouncedRecipientsOptions** | [**FilterBouncedRecipientsOptions**](FilterBouncedRecipientsOptions) | | + +### Return type + +[**FilterBouncedRecipientsResult**](FilterBouncedRecipientsResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getBouncedEmail** +```swift + open class func getBouncedEmail( _id: UUID) -> Promise +``` + +Get a bounced email. + +Bounced emails are email you have sent that were rejected by a recipient + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of the bounced email to fetch + +// Get a bounced email. +BounceControllerAPI.getBouncedEmail(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of the bounced email to fetch | + +### Return type + +[**BouncedEmailDto**](BouncedEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getBouncedEmails** +```swift + open class func getBouncedEmails( page: Int? = nil, size: Int? = nil, sort: Sort_getBouncedEmails? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get paginated list of bounced emails. + +Bounced emails are email you have sent that were rejected by a recipient + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index (optional) (default to 0) +let size = 987 // Int | Optional page size (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get paginated list of bounced emails. +BounceControllerAPI.getBouncedEmails(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index | [optional] [default to 0] + **size** | **Int** | Optional page size | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageBouncedEmail**](PageBouncedEmail) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getBouncedRecipient** +```swift + open class func getBouncedRecipient( _id: UUID) -> Promise +``` + +Get a bounced email. + +Bounced emails are email you have sent that were rejected by a recipient + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of the bounced recipient + +// Get a bounced email. +BounceControllerAPI.getBouncedRecipient(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of the bounced recipient | + +### Return type + +[**BouncedRecipientDto**](BouncedRecipientDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getBouncedRecipients** +```swift + open class func getBouncedRecipients( page: Int? = nil, size: Int? = nil, sort: Sort_getBouncedRecipients? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get paginated list of bounced recipients. + +Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index (optional) (default to 0) +let size = 987 // Int | Optional page size (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get paginated list of bounced recipients. +BounceControllerAPI.getBouncedRecipients(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index | [optional] [default to 0] + **size** | **Int** | Optional page size | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageBouncedRecipients**](PageBouncedRecipients) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getComplaints** +```swift + open class func getComplaints( page: Int? = nil, size: Int? = nil, sort: Sort_getComplaints? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get paginated list of complaints. + +SMTP complaints made against your account + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index (optional) (default to 0) +let size = 987 // Int | Optional page size (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get paginated list of complaints. +BounceControllerAPI.getComplaints(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index | [optional] [default to 0] + **size** | **Int** | Optional page size | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageComplaint**](PageComplaint) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/BounceProjection.md b/docs/BounceProjection.md new file mode 100644 index 00000000..1a8a979d --- /dev/null +++ b/docs/BounceProjection.md @@ -0,0 +1,15 @@ +# BounceProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**sender** | **String** | | +**subject** | **String** | | [optional] +**createdAt** | **Date** | | +**bounceMta** | **String** | | [optional] +**bounceType** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/BounceRecipientProjection.md b/docs/BounceRecipientProjection.md new file mode 100644 index 00000000..4387b549 --- /dev/null +++ b/docs/BounceRecipientProjection.md @@ -0,0 +1,15 @@ +# BounceRecipientProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**action** | **String** | | [optional] +**status** | **String** | | [optional] +**sentEmailId** | **UUID** | | [optional] +**createdAt** | **Date** | | +**recipient** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/BouncedEmailDto.md b/docs/BouncedEmailDto.md new file mode 100644 index 00000000..84184b3c --- /dev/null +++ b/docs/BouncedEmailDto.md @@ -0,0 +1,21 @@ +# BouncedEmailDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**userId** | **UUID** | | +**notificationType** | **String** | | +**sentToRecipients** | **[String]** | | [optional] +**sender** | **String** | | +**bounceMta** | **String** | | [optional] +**bounceType** | **String** | | [optional] +**bounceRecipients** | **[String]** | | [optional] +**bounceSubType** | **String** | | [optional] +**sentEmailId** | **UUID** | | [optional] +**subject** | **String** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/BouncedRecipientDto.md b/docs/BouncedRecipientDto.md new file mode 100644 index 00000000..6a536eab --- /dev/null +++ b/docs/BouncedRecipientDto.md @@ -0,0 +1,17 @@ +# BouncedRecipientDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**userId** | **UUID** | | [optional] +**sentEmailId** | **UUID** | | [optional] +**recipient** | **String** | | +**diagnosticCode** | **String** | | [optional] +**action** | **String** | | [optional] +**status** | **String** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/BulkActionsControllerAPI.md b/docs/BulkActionsControllerAPI.md new file mode 100644 index 00000000..eda6a736 --- /dev/null +++ b/docs/BulkActionsControllerAPI.md @@ -0,0 +1,146 @@ +# BulkActionsControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bulkCreateInboxes**](BulkActionsControllerAPI#bulkcreateinboxes) | **POST** /bulk/inboxes | Bulk create Inboxes (email addresses) +[**bulkDeleteInboxes**](BulkActionsControllerAPI#bulkdeleteinboxes) | **DELETE** /bulk/inboxes | Bulk Delete Inboxes +[**bulkSendEmails**](BulkActionsControllerAPI#bulksendemails) | **POST** /bulk/send | Bulk Send Emails + + +# **bulkCreateInboxes** +```swift + open class func bulkCreateInboxes( count: Int) -> Promise<[InboxDto]> +``` + +Bulk create Inboxes (email addresses) + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let count = 987 // Int | Number of inboxes to be created in bulk + +// Bulk create Inboxes (email addresses) +BulkActionsControllerAPI.bulkCreateInboxes(count: count).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **count** | **Int** | Number of inboxes to be created in bulk | + +### Return type + +[**[InboxDto]**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **bulkDeleteInboxes** +```swift + open class func bulkDeleteInboxes( requestBody: [UUID]) -> Promise +``` + +Bulk Delete Inboxes + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let requestBody = [123] // [UUID] | + +// Bulk Delete Inboxes +BulkActionsControllerAPI.bulkDeleteInboxes(requestBody: requestBody).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**[UUID]**](UUID) | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **bulkSendEmails** +```swift + open class func bulkSendEmails( bulkSendEmailOptions: BulkSendEmailOptions) -> Promise +``` + +Bulk Send Emails + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let bulkSendEmailOptions = BulkSendEmailOptions(inboxIds: [123], sendEmailOptions: SendEmailOptions(toContacts: [123], toGroup: 123, to: ["to_example"], from: "from_example", cc: ["cc_example"], bcc: ["bcc_example"], subject: "subject_example", replyTo: "replyTo_example", body: "body_example", html: false, isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, addTrackingPixel: false, filterBouncedRecipients: false, validateEmailAddresses: "validateEmailAddresses_example")) // BulkSendEmailOptions | + +// Bulk Send Emails +BulkActionsControllerAPI.bulkSendEmails(bulkSendEmailOptions: bulkSendEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bulkSendEmailOptions** | [**BulkSendEmailOptions**](BulkSendEmailOptions) | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/BulkSendEmailOptions.md b/docs/BulkSendEmailOptions.md new file mode 100644 index 00000000..a73dc879 --- /dev/null +++ b/docs/BulkSendEmailOptions.md @@ -0,0 +1,11 @@ +# BulkSendEmailOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxIds** | **[UUID]** | Inboxes to send the email from | +**sendEmailOptions** | [**SendEmailOptions**](SendEmailOptions) | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CommonActionsControllerAPI.md b/docs/CommonActionsControllerAPI.md new file mode 100644 index 00000000..2a1f5199 --- /dev/null +++ b/docs/CommonActionsControllerAPI.md @@ -0,0 +1,288 @@ +# CommonActionsControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createNewEmailAddress**](CommonActionsControllerAPI#createnewemailaddress) | **POST** /newEmailAddress | Create new random inbox +[**createRandomInbox**](CommonActionsControllerAPI#createrandominbox) | **POST** /createInbox | Create new random inbox +[**deleteEmailAddress**](CommonActionsControllerAPI#deleteemailaddress) | **DELETE** /deleteEmailAddress | Delete inbox email address by inbox id +[**emptyInbox**](CommonActionsControllerAPI#emptyinbox) | **DELETE** /emptyInbox | Delete all emails in an inbox +[**sendEmailSimple**](CommonActionsControllerAPI#sendemailsimple) | **POST** /sendEmail | Send an email + + +# **createNewEmailAddress** +```swift + open class func createNewEmailAddress( allowTeamAccess: Bool? = nil, useDomainPool: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, emailAddress: String? = nil, inboxType: InboxType_createNewEmailAddress? = nil, _description: String? = nil, name: String? = nil, tags: [String]? = nil, favourite: Bool? = nil, virtualInbox: Bool? = nil) -> Promise +``` + +Create new random inbox + +Returns an Inbox with an `id` and an `emailAddress` + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let allowTeamAccess = true // Bool | (optional) +let useDomainPool = true // Bool | (optional) +let expiresAt = Date() // Date | (optional) +let expiresIn = 987 // Int64 | (optional) +let emailAddress = "emailAddress_example" // String | (optional) +let inboxType = "inboxType_example" // String | (optional) +let _description = "_description_example" // String | (optional) +let name = "name_example" // String | (optional) +let tags = ["inner_example"] // [String] | (optional) +let favourite = true // Bool | (optional) +let virtualInbox = true // Bool | (optional) + +// Create new random inbox +CommonActionsControllerAPI.createNewEmailAddress(allowTeamAccess: allowTeamAccess, useDomainPool: useDomainPool, expiresAt: expiresAt, expiresIn: expiresIn, emailAddress: emailAddress, inboxType: inboxType, _description: _description, name: name, tags: tags, favourite: favourite, virtualInbox: virtualInbox).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **allowTeamAccess** | **Bool** | | [optional] + **useDomainPool** | **Bool** | | [optional] + **expiresAt** | **Date** | | [optional] + **expiresIn** | **Int64** | | [optional] + **emailAddress** | **String** | | [optional] + **inboxType** | **String** | | [optional] + **_description** | **String** | | [optional] + **name** | **String** | | [optional] + **tags** | [**[String]**](String) | | [optional] + **favourite** | **Bool** | | [optional] + **virtualInbox** | **Bool** | | [optional] + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createRandomInbox** +```swift + open class func createRandomInbox( allowTeamAccess: Bool? = nil, useDomainPool: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, emailAddress: String? = nil, inboxType: InboxType_createRandomInbox? = nil, _description: String? = nil, name: String? = nil, tags: [String]? = nil, favourite: Bool? = nil, virtualInbox: Bool? = nil) -> Promise +``` + +Create new random inbox + +Returns an Inbox with an `id` and an `emailAddress` + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let allowTeamAccess = true // Bool | (optional) +let useDomainPool = true // Bool | (optional) +let expiresAt = Date() // Date | (optional) +let expiresIn = 987 // Int64 | (optional) +let emailAddress = "emailAddress_example" // String | (optional) +let inboxType = "inboxType_example" // String | (optional) +let _description = "_description_example" // String | (optional) +let name = "name_example" // String | (optional) +let tags = ["inner_example"] // [String] | (optional) +let favourite = true // Bool | (optional) +let virtualInbox = true // Bool | (optional) + +// Create new random inbox +CommonActionsControllerAPI.createRandomInbox(allowTeamAccess: allowTeamAccess, useDomainPool: useDomainPool, expiresAt: expiresAt, expiresIn: expiresIn, emailAddress: emailAddress, inboxType: inboxType, _description: _description, name: name, tags: tags, favourite: favourite, virtualInbox: virtualInbox).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **allowTeamAccess** | **Bool** | | [optional] + **useDomainPool** | **Bool** | | [optional] + **expiresAt** | **Date** | | [optional] + **expiresIn** | **Int64** | | [optional] + **emailAddress** | **String** | | [optional] + **inboxType** | **String** | | [optional] + **_description** | **String** | | [optional] + **name** | **String** | | [optional] + **tags** | [**[String]**](String) | | [optional] + **favourite** | **Bool** | | [optional] + **virtualInbox** | **Bool** | | [optional] + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteEmailAddress** +```swift + open class func deleteEmailAddress( inboxId: UUID) -> Promise +``` + +Delete inbox email address by inbox id + +Deletes inbox email address + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Delete inbox email address by inbox id +CommonActionsControllerAPI.deleteEmailAddress(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **emptyInbox** +```swift + open class func emptyInbox( inboxId: UUID) -> Promise +``` + +Delete all emails in an inbox + +Deletes all emails + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Delete all emails in an inbox +CommonActionsControllerAPI.emptyInbox(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendEmailSimple** +```swift + open class func sendEmailSimple( simpleSendEmailOptions: SimpleSendEmailOptions) -> Promise +``` + +Send an email + +If no senderId or inboxId provided a random email address will be used to send from. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let simpleSendEmailOptions = SimpleSendEmailOptions(senderId: 123, to: "to_example", body: "body_example", subject: "subject_example") // SimpleSendEmailOptions | + +// Send an email +CommonActionsControllerAPI.sendEmailSimple(simpleSendEmailOptions: simpleSendEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **simpleSendEmailOptions** | [**SimpleSendEmailOptions**](SimpleSendEmailOptions) | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/Complaint.md b/docs/Complaint.md new file mode 100644 index 00000000..2955e9d2 --- /dev/null +++ b/docs/Complaint.md @@ -0,0 +1,17 @@ +# Complaint + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | [optional] +**eventType** | **String** | | [optional] +**mailSource** | **String** | | [optional] +**mailMessageId** | **String** | | [optional] +**complaintRecipient** | **String** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ConditionOption.md b/docs/ConditionOption.md new file mode 100644 index 00000000..0c7071bf --- /dev/null +++ b/docs/ConditionOption.md @@ -0,0 +1,11 @@ +# ConditionOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**condition** | **String** | Condition of an email object that can be used to filter results | +**value** | **String** | Expected condition value | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ContactControllerAPI.md b/docs/ContactControllerAPI.md new file mode 100644 index 00000000..9d942bcd --- /dev/null +++ b/docs/ContactControllerAPI.md @@ -0,0 +1,288 @@ +# ContactControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createContact**](ContactControllerAPI#createcontact) | **POST** /contacts | Create a contact +[**deleteContact**](ContactControllerAPI#deletecontact) | **DELETE** /contacts/{contactId} | Delete contact +[**getAllContacts**](ContactControllerAPI#getallcontacts) | **GET** /contacts/paginated | Get all contacts +[**getContact**](ContactControllerAPI#getcontact) | **GET** /contacts/{contactId} | Get contact +[**getContactVCard**](ContactControllerAPI#getcontactvcard) | **GET** /contacts/{contactId}/download | Get contact vCard vcf file +[**getContacts**](ContactControllerAPI#getcontacts) | **GET** /contacts | Get all contacts + + +# **createContact** +```swift + open class func createContact( createContactOptions: CreateContactOptions) -> Promise +``` + +Create a contact + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createContactOptions = CreateContactOptions(firstName: "firstName_example", lastName: "lastName_example", company: "company_example", emailAddresses: ["emailAddresses_example"], tags: ["tags_example"], metaData: "TODO", optOut: false, groupId: 123) // CreateContactOptions | + +// Create a contact +ContactControllerAPI.createContact(createContactOptions: createContactOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createContactOptions** | [**CreateContactOptions**](CreateContactOptions) | | + +### Return type + +[**ContactDto**](ContactDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteContact** +```swift + open class func deleteContact( contactId: UUID) -> Promise +``` + +Delete contact + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let contactId = 987 // UUID | + +// Delete contact +ContactControllerAPI.deleteContact(contactId: contactId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contactId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllContacts** +```swift + open class func getAllContacts( page: Int? = nil, size: Int? = nil, sort: Sort_getAllContacts? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all contacts + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get all contacts +ContactControllerAPI.getAllContacts(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageContactProjection**](PageContactProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getContact** +```swift + open class func getContact( contactId: UUID) -> Promise +``` + +Get contact + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let contactId = 987 // UUID | + +// Get contact +ContactControllerAPI.getContact(contactId: contactId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contactId** | [**UUID**]() | | + +### Return type + +[**ContactDto**](ContactDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getContactVCard** +```swift + open class func getContactVCard( contactId: UUID) -> Promise<[Data]> +``` + +Get contact vCard vcf file + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let contactId = 987 // UUID | + +// Get contact vCard vcf file +ContactControllerAPI.getContactVCard(contactId: contactId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contactId** | [**UUID**]() | | + +### Return type + +**[Data]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getContacts** +```swift + open class func getContacts() -> Promise<[ContactProjection]> +``` + +Get all contacts + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get all contacts +ContactControllerAPI.getContacts().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[ContactProjection]**](ContactProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/ContactDto.md b/docs/ContactDto.md new file mode 100644 index 00000000..415c29dd --- /dev/null +++ b/docs/ContactDto.md @@ -0,0 +1,20 @@ +# ContactDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**groupId** | **UUID** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**company** | **String** | | [optional] +**emailAddresses** | **[String]** | | +**primaryEmailAddress** | **String** | | [optional] +**tags** | **[String]** | | +**metaData** | [**AnyCodable**]() | | [optional] +**optOut** | **Bool** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ContactProjection.md b/docs/ContactProjection.md new file mode 100644 index 00000000..4ce7a7a3 --- /dev/null +++ b/docs/ContactProjection.md @@ -0,0 +1,17 @@ +# ContactProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**groupId** | **UUID** | | [optional] +**createdAt** | **Date** | | +**lastName** | **String** | | [optional] +**company** | **String** | | [optional] +**emailAddresses** | **[String]** | | [optional] +**optOut** | **Bool** | | +**firstName** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ContentMatchOptions.md b/docs/ContentMatchOptions.md new file mode 100644 index 00000000..f63d7b26 --- /dev/null +++ b/docs/ContentMatchOptions.md @@ -0,0 +1,10 @@ +# ContentMatchOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pattern** | **String** | Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CountDto.md b/docs/CountDto.md new file mode 100644 index 00000000..4ab502d8 --- /dev/null +++ b/docs/CountDto.md @@ -0,0 +1,10 @@ +# CountDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totalElements** | **Int64** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateAliasOptions.md b/docs/CreateAliasOptions.md new file mode 100644 index 00000000..16bea6c3 --- /dev/null +++ b/docs/CreateAliasOptions.md @@ -0,0 +1,13 @@ +# CreateAliasOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emailAddress** | **String** | Email address to be hidden behind alias. Emails sent to the alias email address will be forwarded to this address. If you want to enable replies set useThreads true and the reply-to for the email will allow outbound communication via a thread. | +**inboxId** | **UUID** | Optional inbox ID to attach to alias. Null by default means an a new inbox will be created for the alias. Use a custom inbox to control what email address the alias uses. To use custom email addresses create a domain and an inbox, the use the inbox ID with this call. Emails received by this inbox will be forwarded to the alias email address | [optional] +**name** | **String** | Optional name for alias | [optional] +**useThreads** | **Bool** | Enable threads options. If true emails will be sent with a unique reply-to thread address. This means you can reply to the forwarded email and it will be sent to the recipients via your alias address. That way a thread conversation is preserved. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateContactOptions.md b/docs/CreateContactOptions.md new file mode 100644 index 00000000..befef745 --- /dev/null +++ b/docs/CreateContactOptions.md @@ -0,0 +1,17 @@ +# CreateContactOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**company** | **String** | | [optional] +**emailAddresses** | **[String]** | Set of email addresses belonging to the contact | [optional] +**tags** | **[String]** | Tags that can be used to search and group contacts | [optional] +**metaData** | [**AnyCodable**]() | | [optional] +**optOut** | **Bool** | Has the user explicitly or implicitly opted out of being contacted? If so MailSlurp will ignore them in all actions. | [optional] +**groupId** | **UUID** | Group IDs that contact belongs to | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateDomainOptions.md b/docs/CreateDomainOptions.md new file mode 100644 index 00000000..1ce9d53f --- /dev/null +++ b/docs/CreateDomainOptions.md @@ -0,0 +1,13 @@ +# CreateDomainOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **String** | The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain. | +**_description** | **String** | Optional description of the domain. | [optional] +**createdCatchAllInbox** | **Bool** | Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID. | [optional] +**domainType** | **String** | Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails. | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateEmergencyAddressOptions.md b/docs/CreateEmergencyAddressOptions.md new file mode 100644 index 00000000..88e58529 --- /dev/null +++ b/docs/CreateEmergencyAddressOptions.md @@ -0,0 +1,16 @@ +# CreateEmergencyAddressOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customerName** | **String** | | +**address1** | **String** | | +**city** | **String** | | +**region** | **String** | | +**postalCode** | **String** | | +**isoCountryCode** | **String** | | +**displayName** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateGroupOptions.md b/docs/CreateGroupOptions.md new file mode 100644 index 00000000..9b73e269 --- /dev/null +++ b/docs/CreateGroupOptions.md @@ -0,0 +1,11 @@ +# CreateGroupOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**_description** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateInboxDto.md b/docs/CreateInboxDto.md new file mode 100644 index 00000000..d691baa3 --- /dev/null +++ b/docs/CreateInboxDto.md @@ -0,0 +1,20 @@ +# CreateInboxDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emailAddress** | **String** | A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. | [optional] +**name** | **String** | Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. | [optional] +**_description** | **String** | Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with | [optional] +**useDomainPool** | **Bool** | Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. | [optional] +**tags** | **[String]** | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. | [optional] +**expiresAt** | **Date** | Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. | [optional] +**favourite** | **Bool** | Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering | [optional] +**expiresIn** | **Int64** | Number of milliseconds that inbox should exist for | [optional] +**allowTeamAccess** | **Bool** | DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. | [optional] +**inboxType** | **String** | Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). | [optional] +**virtualInbox** | **Bool** | Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateInboxForwarderOptions.md b/docs/CreateInboxForwarderOptions.md new file mode 100644 index 00000000..902388b5 --- /dev/null +++ b/docs/CreateInboxForwarderOptions.md @@ -0,0 +1,12 @@ +# CreateInboxForwarderOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **String** | Field to match against to trigger inbox forwarding for inbound email | +**match** | **String** | String or wildcard style match for field specified when evaluating forwarding rules | +**forwardToRecipients** | **[String]** | Email addresses to forward an email to if it matches the field and match criteria of the forwarder | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateInboxRulesetOptions.md b/docs/CreateInboxRulesetOptions.md new file mode 100644 index 00000000..d52aa635 --- /dev/null +++ b/docs/CreateInboxRulesetOptions.md @@ -0,0 +1,12 @@ +# CreateInboxRulesetOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scope** | **String** | What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively. | +**action** | **String** | Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action. | +**target** | **String** | Target to match emails with. Can be a wild-card type pattern or a valid email address. For instance `*@gmail.com` matches all gmail addresses while `test@gmail.com` matches one address exactly. The target is applied to every recipient field email address when `SENDING_EMAILS` is the scope and is applied to sender of email when `RECEIVING_EMAILS`. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateTemplateOptions.md b/docs/CreateTemplateOptions.md new file mode 100644 index 00000000..22ce1dd3 --- /dev/null +++ b/docs/CreateTemplateOptions.md @@ -0,0 +1,11 @@ +# CreateTemplateOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of template | +**content** | **String** | Template content. Can include moustache style variables such as {{var_name}} | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateTrackingPixelOptions.md b/docs/CreateTrackingPixelOptions.md new file mode 100644 index 00000000..90ae1c13 --- /dev/null +++ b/docs/CreateTrackingPixelOptions.md @@ -0,0 +1,11 @@ +# CreateTrackingPixelOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**recipient** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/CreateWebhookOptions.md b/docs/CreateWebhookOptions.md new file mode 100644 index 00000000..dcaa21d6 --- /dev/null +++ b/docs/CreateWebhookOptions.md @@ -0,0 +1,14 @@ +# CreateWebhookOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **String** | Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation. | +**basicAuth** | [**BasicAuthOptions**](BasicAuthOptions) | | [optional] +**name** | **String** | Optional name for the webhook | [optional] +**eventName** | **String** | Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. | [optional] +**includeHeaders** | [**WebhookHeaders**](WebhookHeaders) | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DNSLookupOptions.md b/docs/DNSLookupOptions.md new file mode 100644 index 00000000..4062791c --- /dev/null +++ b/docs/DNSLookupOptions.md @@ -0,0 +1,12 @@ +# DNSLookupOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hostname** | **String** | List of record types you wish to query such as MX, DNS, TXT, NS, A etc. | +**recordTypes** | **[String]** | List of record types you wish to query such as MX, DNS, TXT, NS, A etc. | +**omitFinalDNSDot** | **Bool** | Optionally control whether to omit the final dot in full DNS name values. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DNSLookupResult.md b/docs/DNSLookupResult.md new file mode 100644 index 00000000..93b2f15b --- /dev/null +++ b/docs/DNSLookupResult.md @@ -0,0 +1,13 @@ +# DNSLookupResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recordType** | **String** | Domain Name Server Record Types | +**ttl** | **Int64** | | +**recordEntries** | **[String]** | | +**name** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DNSLookupResults.md b/docs/DNSLookupResults.md new file mode 100644 index 00000000..373c7cb7 --- /dev/null +++ b/docs/DNSLookupResults.md @@ -0,0 +1,10 @@ +# DNSLookupResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [DNSLookupResult] | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DeliveryStatusDto.md b/docs/DeliveryStatusDto.md new file mode 100644 index 00000000..da3bc589 --- /dev/null +++ b/docs/DeliveryStatusDto.md @@ -0,0 +1,23 @@ +# DeliveryStatusDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**sentId** | **UUID** | | [optional] +**remoteMtaIp** | **String** | | [optional] +**inboxId** | **UUID** | | [optional] +**reportingMta** | **String** | | [optional] +**recipients** | **[String]** | | [optional] +**smtpResponse** | **String** | | [optional] +**smtpStatusCode** | **Int** | | [optional] +**processingTimeMillis** | **Int64** | | [optional] +**received** | **Date** | | [optional] +**subject** | **String** | | [optional] +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DescribeDomainOptions.md b/docs/DescribeDomainOptions.md new file mode 100644 index 00000000..9d8eb081 --- /dev/null +++ b/docs/DescribeDomainOptions.md @@ -0,0 +1,10 @@ +# DescribeDomainOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DescribeMailServerDomainResult.md b/docs/DescribeMailServerDomainResult.md new file mode 100644 index 00000000..15a950d5 --- /dev/null +++ b/docs/DescribeMailServerDomainResult.md @@ -0,0 +1,12 @@ +# DescribeMailServerDomainResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mxRecords** | [NameServerRecord] | | +**domain** | **String** | | +**message** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DomainControllerAPI.md b/docs/DomainControllerAPI.md new file mode 100644 index 00000000..43b16c5c --- /dev/null +++ b/docs/DomainControllerAPI.md @@ -0,0 +1,294 @@ +# DomainControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addDomainWildcardCatchAll**](DomainControllerAPI#adddomainwildcardcatchall) | **POST** /domains/{id}/wildcard | Add catch all wild card inbox to domain +[**createDomain**](DomainControllerAPI#createdomain) | **POST** /domains | Create Domain +[**deleteDomain**](DomainControllerAPI#deletedomain) | **DELETE** /domains/{id} | Delete a domain +[**getDomain**](DomainControllerAPI#getdomain) | **GET** /domains/{id} | Get a domain +[**getDomains**](DomainControllerAPI#getdomains) | **GET** /domains | Get domains +[**updateDomain**](DomainControllerAPI#updatedomain) | **PUT** /domains/{id} | Update a domain + + +# **addDomainWildcardCatchAll** +```swift + open class func addDomainWildcardCatchAll( _id: UUID) -> Promise +``` + +Add catch all wild card inbox to domain + +Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Add catch all wild card inbox to domain +DomainControllerAPI.addDomainWildcardCatchAll(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +[**DomainDto**](DomainDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createDomain** +```swift + open class func createDomain( createDomainOptions: CreateDomainOptions) -> Promise +``` + +Create Domain + +Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createDomainOptions = CreateDomainOptions(domain: "domain_example", _description: "_description_example", createdCatchAllInbox: false, domainType: "domainType_example") // CreateDomainOptions | + +// Create Domain +DomainControllerAPI.createDomain(createDomainOptions: createDomainOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createDomainOptions** | [**CreateDomainOptions**](CreateDomainOptions) | | + +### Return type + +[**DomainDto**](DomainDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteDomain** +```swift + open class func deleteDomain( _id: UUID) -> Promise<[String]> +``` + +Delete a domain + +Delete a domain. This will disable any existing inboxes that use this domain. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Delete a domain +DomainControllerAPI.deleteDomain(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +**[String]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getDomain** +```swift + open class func getDomain( _id: UUID) -> Promise +``` + +Get a domain + +Returns domain verification status and tokens for a given domain + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Get a domain +DomainControllerAPI.getDomain(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +[**DomainDto**](DomainDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getDomains** +```swift + open class func getDomains() -> Promise<[DomainPreview]> +``` + +Get domains + +List all custom domains you have created + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get domains +DomainControllerAPI.getDomains().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[DomainPreview]**](DomainPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **updateDomain** +```swift + open class func updateDomain( _id: UUID, updateDomainOptions: UpdateDomainOptions) -> Promise +``` + +Update a domain + +Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | +let updateDomainOptions = UpdateDomainOptions(catchAllInboxId: 123) // UpdateDomainOptions | + +// Update a domain +DomainControllerAPI.updateDomain(_id: _id, updateDomainOptions: updateDomainOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + **updateDomainOptions** | [**UpdateDomainOptions**](UpdateDomainOptions) | | + +### Return type + +[**DomainDto**](DomainDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/DomainDto.md b/docs/DomainDto.md new file mode 100644 index 00000000..3a9f69f1 --- /dev/null +++ b/docs/DomainDto.md @@ -0,0 +1,20 @@ +# DomainDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**domain** | **String** | Custom domain name | +**verificationToken** | **String** | Verification tokens | +**dkimTokens** | **[String]** | Unique token DKIM tokens | +**isVerified** | **Bool** | Whether domain has been verified or not. If the domain is not verified after 72 hours there is most likely an issue with the domains DNS records. | +**domainNameRecords** | [DomainNameRecord] | List of DNS domain name records (C, MX, TXT) etc that you must add to the DNS server associated with your domain provider. | +**catchAllInboxId** | **UUID** | The optional catch all inbox that will receive emails sent to the domain that cannot be matched. | [optional] +**createdAt** | **Date** | | +**updatedAt** | **Date** | | +**domainType** | **String** | Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DomainNameRecord.md b/docs/DomainNameRecord.md new file mode 100644 index 00000000..a05d1327 --- /dev/null +++ b/docs/DomainNameRecord.md @@ -0,0 +1,13 @@ +# DomainNameRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recordType** | **String** | Domain Name Server Record Types | +**name** | **String** | | +**recordEntries** | **[String]** | | +**ttl** | **Int64** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DomainPreview.md b/docs/DomainPreview.md new file mode 100644 index 00000000..43ca22d2 --- /dev/null +++ b/docs/DomainPreview.md @@ -0,0 +1,15 @@ +# DomainPreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**domain** | **String** | | +**catchAllInboxId** | **UUID** | | [optional] +**createdAt** | **Date** | | +**domainType** | **String** | Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails. | +**isVerified** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/DownloadAttachmentDto.md b/docs/DownloadAttachmentDto.md new file mode 100644 index 00000000..030c2813 --- /dev/null +++ b/docs/DownloadAttachmentDto.md @@ -0,0 +1,12 @@ +# DownloadAttachmentDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**base64FileContents** | **String** | Base64 encoded string of attachment bytes. Decode the base64 encoded string to get the raw contents. If the file has a content type such as `text/html` you can read the contents directly by converting it to string using `utf-8` encoding. | +**contentType** | **String** | Content type of attachment. Examples are `image/png`, `application/msword`, `text/csv` etc. | +**sizeBytes** | **Int64** | Size in bytes of attachment content | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/Email.md b/docs/Email.md new file mode 100644 index 00000000..f211b866 --- /dev/null +++ b/docs/Email.md @@ -0,0 +1,34 @@ +# Email + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of the email entity | +**userId** | **UUID** | ID of user that email belongs to | +**inboxId** | **UUID** | ID of the inbox that received the email | +**domainId** | **UUID** | ID of the domain that received the email | [optional] +**to** | **[String]** | List of `To` recipient email addresses that the email was addressed to. See recipients object for names. | +**from** | **String** | Who the email was sent from. An email address - see fromName for the sender name. | [optional] +**sender** | [**Sender**](Sender) | | [optional] +**recipients** | [**EmailRecipients**](EmailRecipients) | | [optional] +**replyTo** | **String** | The `replyTo` field on the received email message | [optional] +**cc** | **[String]** | List of `CC` recipients email addresses that the email was addressed to. See recipients object for names. | [optional] +**bcc** | **[String]** | List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names. | [optional] +**headers** | **[String: String]** | Collection of SMTP headers attached to email | [optional] +**attachments** | **[String]** | List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension. | [optional] +**subject** | **String** | The subject line of the email message as specified by SMTP subject header | [optional] +**body** | **String** | The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests. | [optional] +**bodyExcerpt** | **String** | An excerpt of the body of the email message for quick preview . | [optional] +**bodyMD5Hash** | **String** | A hash signature of the email message using MD5. Useful for comparing emails without fetching full body. | [optional] +**isHTML** | **Bool** | Is the email body content type HTML? | [optional] +**charset** | **String** | Detected character set of the email body such as UTF-8 | [optional] +**analysis** | [**EmailAnalysis**](EmailAnalysis) | | [optional] +**createdAt** | **Date** | When was the email received by MailSlurp | +**updatedAt** | **Date** | When was the email last updated | +**read** | **Bool** | Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks. | +**teamAccess** | **Bool** | Can the email be accessed by organization team members | +**html** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailAnalysis.md b/docs/EmailAnalysis.md new file mode 100644 index 00000000..caefd137 --- /dev/null +++ b/docs/EmailAnalysis.md @@ -0,0 +1,14 @@ +# EmailAnalysis + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spamVerdict** | **String** | Verdict of spam ranking analysis | [optional] +**virusVerdict** | **String** | Verdict of virus scan analysis | [optional] +**spfVerdict** | **String** | Verdict of Send Policy Framework record spoofing analysis | [optional] +**dkimVerdict** | **String** | Verdict of DomainKeys Identified Mail analysis | [optional] +**dmarcVerdict** | **String** | Verdict of Domain-based Message Authentication Reporting and Conformance analysis | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailContentMatchResult.md b/docs/EmailContentMatchResult.md new file mode 100644 index 00000000..a7506f92 --- /dev/null +++ b/docs/EmailContentMatchResult.md @@ -0,0 +1,11 @@ +# EmailContentMatchResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pattern** | **String** | | +**matches** | **[String]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailControllerAPI.md b/docs/EmailControllerAPI.md new file mode 100644 index 00000000..b02ae4c2 --- /dev/null +++ b/docs/EmailControllerAPI.md @@ -0,0 +1,1547 @@ +# EmailControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**applyImapFlagOperation**](EmailControllerAPI#applyimapflagoperation) | **POST** /emails/{emailId}/imap-flag-operation | Set IMAP flags associated with a message. Only supports '\\Seen' flag. +[**deleteAllEmails**](EmailControllerAPI#deleteallemails) | **DELETE** /emails | Delete all emails in all inboxes. +[**deleteEmail**](EmailControllerAPI#deleteemail) | **DELETE** /emails/{emailId} | Delete an email +[**downloadAttachment**](EmailControllerAPI#downloadattachment) | **GET** /emails/{emailId}/attachments/{attachmentId} | Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. +[**downloadAttachmentBase64**](EmailControllerAPI#downloadattachmentbase64) | **GET** /emails/{emailId}/attachments/{attachmentId}/base64 | Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. +[**downloadBody**](EmailControllerAPI#downloadbody) | **GET** /emails/{emailId}/body | Get email body as string. Returned as `plain/text` with content type header. +[**downloadBodyBytes**](EmailControllerAPI#downloadbodybytes) | **GET** /emails/{emailId}/body-bytes | Get email body in bytes. Returned as `octet-stream` with content type header. +[**forwardEmail**](EmailControllerAPI#forwardemail) | **POST** /emails/{emailId}/forward | Forward email to recipients +[**getAttachmentMetaData**](EmailControllerAPI#getattachmentmetadata) | **GET** /emails/{emailId}/attachments/{attachmentId}/metadata | Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. +[**getEmail**](EmailControllerAPI#getemail) | **GET** /emails/{emailId} | Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController. +[**getEmailAttachments**](EmailControllerAPI#getemailattachments) | **GET** /emails/{emailId}/attachments | Get all email attachment metadata. Metadata includes name and size of attachments. +[**getEmailContentMatch**](EmailControllerAPI#getemailcontentmatch) | **POST** /emails/{emailId}/contentMatch | Get email content regex pattern match results. Runs regex against email body and returns match groups. +[**getEmailCount**](EmailControllerAPI#getemailcount) | **GET** /emails/emails/count | Get email count +[**getEmailHTML**](EmailControllerAPI#getemailhtml) | **GET** /emails/{emailId}/html | Get email content as HTML. For displaying emails in browser context. +[**getEmailHTMLJson**](EmailControllerAPI#getemailhtmljson) | **GET** /emails/{emailId}/html/json | Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content +[**getEmailHTMLQuery**](EmailControllerAPI#getemailhtmlquery) | **GET** /emails/{emailId}/htmlQuery | Parse and return text from an email, stripping HTML and decoding encoded characters +[**getEmailLinks**](EmailControllerAPI#getemaillinks) | **GET** /emails/{emailId}/links | Parse and return list of links found in an email (only works for HTML content) +[**getEmailPreviewURLs**](EmailControllerAPI#getemailpreviewurls) | **GET** /emails/{emailId}/urls | Get email URLs for viewing in browser or downloading +[**getEmailTextLines**](EmailControllerAPI#getemailtextlines) | **GET** /emails/{emailId}/textLines | Parse and return text from an email, stripping HTML and decoding encoded characters +[**getEmailsPaginated**](EmailControllerAPI#getemailspaginated) | **GET** /emails | Get all emails in all inboxes in paginated form. Email API list all. +[**getGravatarUrlForEmailAddress**](EmailControllerAPI#getgravatarurlforemailaddress) | **GET** /emails/gravatarFor | +[**getLatestEmail**](EmailControllerAPI#getlatestemail) | **GET** /emails/latest | Get latest email in all inboxes. Most recently received. +[**getLatestEmailInInbox1**](EmailControllerAPI#getlatestemailininbox1) | **GET** /emails/latestIn | Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. +[**getOrganizationEmailsPaginated**](EmailControllerAPI#getorganizationemailspaginated) | **GET** /emails/organization | Get all organization emails. List team or shared test email accounts +[**getRawEmailContents**](EmailControllerAPI#getrawemailcontents) | **GET** /emails/{emailId}/raw | Get raw email string. Returns unparsed raw SMTP message with headers and body. +[**getRawEmailJson**](EmailControllerAPI#getrawemailjson) | **GET** /emails/{emailId}/raw/json | Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. +[**getUnreadEmailCount**](EmailControllerAPI#getunreademailcount) | **GET** /emails/unreadCount | Get unread email count +[**markAsRead**](EmailControllerAPI#markasread) | **PATCH** /emails/{emailId}/read | Mark an email as read on unread +[**replyToEmail**](EmailControllerAPI#replytoemail) | **PUT** /emails/{emailId} | Reply to an email +[**sendEmailSourceOptional**](EmailControllerAPI#sendemailsourceoptional) | **POST** /emails | Send email +[**validateEmail**](EmailControllerAPI#validateemail) | **POST** /emails/{emailId}/validate | Validate email HTML contents + + +# **applyImapFlagOperation** +```swift + open class func applyImapFlagOperation( emailId: UUID, imapFlagOperationOptions: ImapFlagOperationOptions) -> Promise +``` + +Set IMAP flags associated with a message. Only supports '\\Seen' flag. + +Apply RFC3501 section-2.3.2 IMAP flag operations on an email + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | +let imapFlagOperationOptions = ImapFlagOperationOptions(flagOperation: "flagOperation_example", flags: ["flags_example"]) // ImapFlagOperationOptions | + +// Set IMAP flags associated with a message. Only supports '\\Seen' flag. +EmailControllerAPI.applyImapFlagOperation(emailId: emailId, imapFlagOperationOptions: imapFlagOperationOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | | + **imapFlagOperationOptions** | [**ImapFlagOperationOptions**](ImapFlagOperationOptions) | | + +### Return type + +[**EmailPreview**](EmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteAllEmails** +```swift + open class func deleteAllEmails() -> Promise +``` + +Delete all emails in all inboxes. + +Deletes all emails in your account. Be careful as emails cannot be recovered + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Delete all emails in all inboxes. +EmailControllerAPI.deleteAllEmails().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteEmail** +```swift + open class func deleteEmail( emailId: UUID) -> Promise +``` + +Delete an email + +Deletes an email and removes it from the inbox. Deleted emails cannot be recovered. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email to delete + +// Delete an email +EmailControllerAPI.deleteEmail(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email to delete | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **downloadAttachment** +```swift + open class func downloadAttachment( emailId: UUID, attachmentId: String, apiKey: String? = nil) -> Promise +``` + +Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. + +Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email +let attachmentId = "attachmentId_example" // String | ID of attachment +let apiKey = "apiKey_example" // String | Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional) + +// Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. +EmailControllerAPI.downloadAttachment(emailId: emailId, attachmentId: attachmentId, apiKey: apiKey).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + **attachmentId** | **String** | ID of attachment | + **apiKey** | **String** | Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. | [optional] + +### Return type + +**Data** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **downloadAttachmentBase64** +```swift + open class func downloadAttachmentBase64( emailId: UUID, attachmentId: String) -> Promise +``` + +Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. + +Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. +EmailControllerAPI.downloadAttachmentBase64(emailId: emailId, attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + **attachmentId** | **String** | ID of attachment | + +### Return type + +[**DownloadAttachmentDto**](DownloadAttachmentDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **downloadBody** +```swift + open class func downloadBody( emailId: UUID) -> Promise +``` + +Get email body as string. Returned as `plain/text` with content type header. + +Returns the specified email body for a given email as a string + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get email body as string. Returned as `plain/text` with content type header. +EmailControllerAPI.downloadBody(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, text/html + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **downloadBodyBytes** +```swift + open class func downloadBodyBytes( emailId: UUID) -> Promise +``` + +Get email body in bytes. Returned as `octet-stream` with content type header. + +Returns the specified email body for a given email as a stream / array of bytes. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get email body in bytes. Returned as `octet-stream` with content type header. +EmailControllerAPI.downloadBodyBytes(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +**Data** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **forwardEmail** +```swift + open class func forwardEmail( emailId: UUID, forwardEmailOptions: ForwardEmailOptions) -> Promise +``` + +Forward email to recipients + +Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the `from` option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email +let forwardEmailOptions = ForwardEmailOptions(to: ["to_example"], subject: "subject_example", cc: ["cc_example"], bcc: ["bcc_example"], from: "from_example", useInboxName: false) // ForwardEmailOptions | + +// Forward email to recipients +EmailControllerAPI.forwardEmail(emailId: emailId, forwardEmailOptions: forwardEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + **forwardEmailOptions** | [**ForwardEmailOptions**](ForwardEmailOptions) | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAttachmentMetaData** +```swift + open class func getAttachmentMetaData( emailId: UUID, attachmentId: String) -> Promise +``` + +Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. + +Returns the metadata such as name and content-type for a given attachment and email. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email +let attachmentId = "attachmentId_example" // String | ID of attachment + +// Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. +EmailControllerAPI.getAttachmentMetaData(emailId: emailId, attachmentId: attachmentId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + **attachmentId** | **String** | ID of attachment | + +### Return type + +[**AttachmentMetaData**](AttachmentMetaData) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmail** +```swift + open class func getEmail( emailId: UUID, decode: Bool? = nil) -> Promise +``` + +Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController. + +Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | +let decode = true // Bool | Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional) (default to false) + +// Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController. +EmailControllerAPI.getEmail(emailId: emailId, decode: decode).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | | + **decode** | **Bool** | Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing | [optional] [default to false] + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailAttachments** +```swift + open class func getEmailAttachments( emailId: UUID) -> Promise<[AttachmentMetaData]> +``` + +Get all email attachment metadata. Metadata includes name and size of attachments. + +Returns an array of attachment metadata such as name and content-type for a given email if present. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get all email attachment metadata. Metadata includes name and size of attachments. +EmailControllerAPI.getEmailAttachments(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +[**[AttachmentMetaData]**](AttachmentMetaData) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailContentMatch** +```swift + open class func getEmailContentMatch( emailId: UUID, contentMatchOptions: ContentMatchOptions) -> Promise +``` + +Get email content regex pattern match results. Runs regex against email body and returns match groups. + +Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email to match against +let contentMatchOptions = ContentMatchOptions(pattern: "pattern_example") // ContentMatchOptions | + +// Get email content regex pattern match results. Runs regex against email body and returns match groups. +EmailControllerAPI.getEmailContentMatch(emailId: emailId, contentMatchOptions: contentMatchOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email to match against | + **contentMatchOptions** | [**ContentMatchOptions**](ContentMatchOptions) | | + +### Return type + +[**EmailContentMatchResult**](EmailContentMatchResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailCount** +```swift + open class func getEmailCount() -> Promise +``` + +Get email count + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get email count +EmailControllerAPI.getEmailCount().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**CountDto**](CountDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailHTML** +```swift + open class func getEmailHTML( emailId: UUID, decode: Bool? = nil) -> Promise +``` + +Get email content as HTML. For displaying emails in browser context. + +Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`. Returns content-type `text/html;charset=utf-8` so you must call expecting that content response not JSON. For JSON response see the `getEmailHTMLJson` method. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | +let decode = true // Bool | (optional) (default to false) + +// Get email content as HTML. For displaying emails in browser context. +EmailControllerAPI.getEmailHTML(emailId: emailId, decode: decode).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | | + **decode** | **Bool** | | [optional] [default to false] + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/html;charset=utf-8, text/html + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailHTMLJson** +```swift + open class func getEmailHTMLJson( emailId: UUID, decode: Bool? = nil) -> Promise +``` + +Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content + +Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type `application/json;charset=utf-8` so you must call expecting that content response not JSON. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | +let decode = true // Bool | (optional) (default to false) + +// Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content +EmailControllerAPI.getEmailHTMLJson(emailId: emailId, decode: decode).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | | + **decode** | **Bool** | | [optional] [default to false] + +### Return type + +[**EmailHtmlDto**](EmailHtmlDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailHTMLQuery** +```swift + open class func getEmailHTMLQuery( emailId: UUID, htmlSelector: String) -> Promise +``` + +Parse and return text from an email, stripping HTML and decoding encoded characters + +Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email to perform HTML query on +let htmlSelector = "htmlSelector_example" // String | HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. + +// Parse and return text from an email, stripping HTML and decoding encoded characters +EmailControllerAPI.getEmailHTMLQuery(emailId: emailId, htmlSelector: htmlSelector).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email to perform HTML query on | + **htmlSelector** | **String** | HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. | + +### Return type + +[**EmailTextLinesResult**](EmailTextLinesResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailLinks** +```swift + open class func getEmailLinks( emailId: UUID) -> Promise +``` + +Parse and return list of links found in an email (only works for HTML content) + +HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email to fetch text for + +// Parse and return list of links found in an email (only works for HTML content) +EmailControllerAPI.getEmailLinks(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email to fetch text for | + +### Return type + +[**EmailLinksResult**](EmailLinksResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailPreviewURLs** +```swift + open class func getEmailPreviewURLs( emailId: UUID) -> Promise +``` + +Get email URLs for viewing in browser or downloading + +Get a list of URLs for email content as text/html or raw SMTP message for viewing the message in a browser. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | + +// Get email URLs for viewing in browser or downloading +EmailControllerAPI.getEmailPreviewURLs(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | | + +### Return type + +[**EmailPreviewUrls**](EmailPreviewUrls) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailTextLines** +```swift + open class func getEmailTextLines( emailId: UUID, decodeHtmlEntities: Bool? = nil, lineSeparator: String? = nil) -> Promise +``` + +Parse and return text from an email, stripping HTML and decoding encoded characters + +Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email to fetch text for +let decodeHtmlEntities = true // Bool | Decode HTML entities (optional) +let lineSeparator = "lineSeparator_example" // String | Line separator character (optional) + +// Parse and return text from an email, stripping HTML and decoding encoded characters +EmailControllerAPI.getEmailTextLines(emailId: emailId, decodeHtmlEntities: decodeHtmlEntities, lineSeparator: lineSeparator).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email to fetch text for | + **decodeHtmlEntities** | **Bool** | Decode HTML entities | [optional] + **lineSeparator** | **String** | Line separator character | [optional] + +### Return type + +[**EmailTextLinesResult**](EmailTextLinesResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmailsPaginated** +```swift + open class func getEmailsPaginated( inboxId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getEmailsPaginated? = nil, unreadOnly: Bool? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all emails in all inboxes in paginated form. Email API list all. + +By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = [123] // [UUID] | Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional) +let page = 987 // Int | Optional page index in email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let unreadOnly = true // Bool | Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional) (default to false) +let searchFilter = "searchFilter_example" // String | Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional) +let since = Date() // Date | Optional filter emails received after given date time (optional) +let before = Date() // Date | Optional filter emails received before given date time (optional) + +// Get all emails in all inboxes in paginated form. Email API list all. +EmailControllerAPI.getEmailsPaginated(inboxId: inboxId, page: page, size: size, sort: sort, unreadOnly: unreadOnly, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**[UUID]**](UUID) | Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. | [optional] + **page** | **Int** | Optional page index in email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **unreadOnly** | **Bool** | Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly | [optional] [default to false] + **searchFilter** | **String** | Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body | [optional] + **since** | **Date** | Optional filter emails received after given date time | [optional] + **before** | **Date** | Optional filter emails received before given date time | [optional] + +### Return type + +[**PageEmailProjection**](PageEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getGravatarUrlForEmailAddress** +```swift + open class func getGravatarUrlForEmailAddress( emailAddress: String, size: String? = nil) -> Promise +``` + + + +Get gravatar url for email address + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailAddress = "emailAddress_example" // String | +let size = "size_example" // String | (optional) + +EmailControllerAPI.getGravatarUrlForEmailAddress(emailAddress: emailAddress, size: size).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailAddress** | **String** | | + **size** | **String** | | [optional] + +### Return type + +[**GravatarUrl**](GravatarUrl) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getLatestEmail** +```swift + open class func getLatestEmail( inboxIds: [UUID]? = nil) -> Promise +``` + +Get latest email in all inboxes. Most recently received. + +Get the newest email in all inboxes or in a passed set of inbox IDs + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxIds = [123] // [UUID] | Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional) + +// Get latest email in all inboxes. Most recently received. +EmailControllerAPI.getLatestEmail(inboxIds: inboxIds).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxIds** | [**[UUID]**](UUID) | Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes | [optional] + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getLatestEmailInInbox1** +```swift + open class func getLatestEmailInInbox1( inboxId: UUID) -> Promise +``` + +Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. + +Get the newest email in all inboxes or in a passed set of inbox IDs + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to get the latest email from + +// Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. +EmailControllerAPI.getLatestEmailInInbox1(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to get the latest email from | + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getOrganizationEmailsPaginated** +```swift + open class func getOrganizationEmailsPaginated( inboxId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getOrganizationEmailsPaginated? = nil, unreadOnly: Bool? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all organization emails. List team or shared test email accounts + +By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = [123] // [UUID] | Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional) +let page = 987 // Int | Optional page index in email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let unreadOnly = true // Bool | Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional) (default to false) +let searchFilter = "searchFilter_example" // String | Optional search filter search filter for emails. (optional) +let since = Date() // Date | Optional filter emails received after given date time (optional) +let before = Date() // Date | Optional filter emails received before given date time (optional) + +// Get all organization emails. List team or shared test email accounts +EmailControllerAPI.getOrganizationEmailsPaginated(inboxId: inboxId, page: page, size: size, sort: sort, unreadOnly: unreadOnly, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**[UUID]**](UUID) | Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. | [optional] + **page** | **Int** | Optional page index in email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **unreadOnly** | **Bool** | Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly | [optional] [default to false] + **searchFilter** | **String** | Optional search filter search filter for emails. | [optional] + **since** | **Date** | Optional filter emails received after given date time | [optional] + **before** | **Date** | Optional filter emails received before given date time | [optional] + +### Return type + +[**PageEmailProjection**](PageEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getRawEmailContents** +```swift + open class func getRawEmailContents( emailId: UUID) -> Promise +``` + +Get raw email string. Returns unparsed raw SMTP message with headers and body. + +Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get raw email string. Returns unparsed raw SMTP message with headers and body. +EmailControllerAPI.getRawEmailContents(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getRawEmailJson** +```swift + open class func getRawEmailJson( emailId: UUID) -> Promise +``` + +Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. + +Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. +EmailControllerAPI.getRawEmailJson(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +[**RawEmailJson**](RawEmailJson) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getUnreadEmailCount** +```swift + open class func getUnreadEmailCount() -> Promise +``` + +Get unread email count + +Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get unread email count +EmailControllerAPI.getUnreadEmailCount().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UnreadCount**](UnreadCount) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **markAsRead** +```swift + open class func markAsRead( emailId: UUID, read: Bool? = nil) -> Promise +``` + +Mark an email as read on unread + +Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | +let read = true // Bool | What value to assign to email read property. Default true. (optional) (default to true) + +// Mark an email as read on unread +EmailControllerAPI.markAsRead(emailId: emailId, read: read).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | | + **read** | **Bool** | What value to assign to email read property. Default true. | [optional] [default to true] + +### Return type + +[**EmailPreview**](EmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **replyToEmail** +```swift + open class func replyToEmail( emailId: UUID, replyToEmailOptions: ReplyToEmailOptions) -> Promise +``` + +Reply to an email + +Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of the email that should be replied to +let replyToEmailOptions = ReplyToEmailOptions(body: "body_example", isHTML: false, from: "from_example", replyTo: "replyTo_example", charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, html: false) // ReplyToEmailOptions | + +// Reply to an email +EmailControllerAPI.replyToEmail(emailId: emailId, replyToEmailOptions: replyToEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of the email that should be replied to | + **replyToEmailOptions** | [**ReplyToEmailOptions**](ReplyToEmailOptions) | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendEmailSourceOptional** +```swift + open class func sendEmailSourceOptional( inboxId: UUID, sendEmailOptions: SendEmailOptions, useDomainPool: Bool? = nil, virtualSend: Bool? = nil) -> Promise +``` + +Send email + +Alias for `InboxController.sendEmail` method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to send the email from +let sendEmailOptions = SendEmailOptions(toContacts: [123], toGroup: 123, to: ["to_example"], from: "from_example", cc: ["cc_example"], bcc: ["bcc_example"], subject: "subject_example", replyTo: "replyTo_example", body: "body_example", html: false, isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, addTrackingPixel: false, filterBouncedRecipients: false, validateEmailAddresses: "validateEmailAddresses_example") // SendEmailOptions | +let useDomainPool = true // Bool | Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional) +let virtualSend = true // Bool | Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional) + +// Send email +EmailControllerAPI.sendEmailSourceOptional(inboxId: inboxId, sendEmailOptions: sendEmailOptions, useDomainPool: useDomainPool, virtualSend: virtualSend).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to send the email from | + **sendEmailOptions** | [**SendEmailOptions**](SendEmailOptions) | | + **useDomainPool** | **Bool** | Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. | [optional] + **virtualSend** | **Bool** | Optionally create inbox to send from that is a virtual inbox and won't send to external addresses | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **validateEmail** +```swift + open class func validateEmail( emailId: UUID) -> Promise +``` + +Validate email HTML contents + +Validate the HTML content of email if HTML is found. Considered valid if no HTML is present. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Validate email HTML contents +EmailControllerAPI.validateEmail(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +[**ValidationDto**](ValidationDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/EmailHtmlDto.md b/docs/EmailHtmlDto.md new file mode 100644 index 00000000..e7d81561 --- /dev/null +++ b/docs/EmailHtmlDto.md @@ -0,0 +1,11 @@ +# EmailHtmlDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subject** | **String** | | [optional] +**body** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailLinksResult.md b/docs/EmailLinksResult.md new file mode 100644 index 00000000..8a894c25 --- /dev/null +++ b/docs/EmailLinksResult.md @@ -0,0 +1,11 @@ +# EmailLinksResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | **[String]** | | +**body** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailPreview.md b/docs/EmailPreview.md new file mode 100644 index 00000000..0615f064 --- /dev/null +++ b/docs/EmailPreview.md @@ -0,0 +1,19 @@ +# EmailPreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of the email entity | +**domainId** | **UUID** | ID of the domain that received the email | [optional] +**subject** | **String** | The subject line of the email message as specified by SMTP subject header | [optional] +**to** | **[String]** | List of `To` recipient email addresses that the email was addressed to. See recipients object for names. | +**from** | **String** | Who the email was sent from. An email address - see fromName for the sender name. | [optional] +**bcc** | **[String]** | List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names. | [optional] +**cc** | **[String]** | List of `CC` recipients email addresses that the email was addressed to. See recipients object for names. | [optional] +**createdAt** | **Date** | When was the email received by MailSlurp | +**read** | **Bool** | Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks. | +**attachments** | **[String]** | List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension. | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailPreviewUrls.md b/docs/EmailPreviewUrls.md new file mode 100644 index 00000000..e6d13ecb --- /dev/null +++ b/docs/EmailPreviewUrls.md @@ -0,0 +1,11 @@ +# EmailPreviewUrls + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rawSmtpMessageUrl** | **String** | | +**plainHtmlBodyUrl** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailProjection.md b/docs/EmailProjection.md new file mode 100644 index 00000000..e761728a --- /dev/null +++ b/docs/EmailProjection.md @@ -0,0 +1,23 @@ +# EmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**from** | **String** | | [optional] +**subject** | **String** | | [optional] +**attachments** | **[String]** | | [optional] +**inboxId** | **UUID** | | +**to** | **[String]** | | +**createdAt** | **Date** | | +**bcc** | **[String]** | | [optional] +**cc** | **[String]** | | [optional] +**domainId** | **UUID** | | [optional] +**bodyMD5Hash** | **String** | | [optional] +**bodyExcerpt** | **String** | | [optional] +**read** | **Bool** | | +**teamAccess** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailRecipients.md b/docs/EmailRecipients.md new file mode 100644 index 00000000..8c951f5b --- /dev/null +++ b/docs/EmailRecipients.md @@ -0,0 +1,12 @@ +# EmailRecipients + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to** | [Recipient] | | [optional] +**cc** | [Recipient] | | [optional] +**bcc** | [Recipient] | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailTextLinesResult.md b/docs/EmailTextLinesResult.md new file mode 100644 index 00000000..8c3d7160 --- /dev/null +++ b/docs/EmailTextLinesResult.md @@ -0,0 +1,11 @@ +# EmailTextLinesResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | **[String]** | | +**body** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailValidationRequest.md b/docs/EmailValidationRequest.md new file mode 100644 index 00000000..6d089f02 --- /dev/null +++ b/docs/EmailValidationRequest.md @@ -0,0 +1,15 @@ +# EmailValidationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**userId** | **UUID** | | +**emailAddress** | **String** | | +**isValid** | **Bool** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmailVerificationControllerAPI.md b/docs/EmailVerificationControllerAPI.md new file mode 100644 index 00000000..61c5bc20 --- /dev/null +++ b/docs/EmailVerificationControllerAPI.md @@ -0,0 +1,112 @@ +# EmailVerificationControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getValidationRequests**](EmailVerificationControllerAPI#getvalidationrequests) | **GET** /email-verification/validation-requests | Validate a list of email addresses. Per unit billing. See your plan for pricing. +[**validateEmailAddressList**](EmailVerificationControllerAPI#validateemailaddresslist) | **POST** /email-verification/email-address-list | Validate a list of email addresses. Per unit billing. See your plan for pricing. + + +# **getValidationRequests** +```swift + open class func getValidationRequests( page: Int? = nil, size: Int? = nil, sort: Sort_getValidationRequests? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, isValid: Bool? = nil) -> Promise +``` + +Validate a list of email addresses. Per unit billing. See your plan for pricing. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size for paginated result list. (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .desc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) +let isValid = true // Bool | Filter where email is valid is true or false (optional) + +// Validate a list of email addresses. Per unit billing. See your plan for pricing. +EmailVerificationControllerAPI.getValidationRequests(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, isValid: isValid).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size for paginated result list. | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .desc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + **isValid** | **Bool** | Filter where email is valid is true or false | [optional] + +### Return type + +[**PageEmailValidationRequest**](PageEmailValidationRequest) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **validateEmailAddressList** +```swift + open class func validateEmailAddressList( validateEmailAddressListOptions: ValidateEmailAddressListOptions) -> Promise +``` + +Validate a list of email addresses. Per unit billing. See your plan for pricing. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let validateEmailAddressListOptions = ValidateEmailAddressListOptions(emailAddressList: ["emailAddressList_example"]) // ValidateEmailAddressListOptions | + +// Validate a list of email addresses. Per unit billing. See your plan for pricing. +EmailVerificationControllerAPI.validateEmailAddressList(validateEmailAddressListOptions: validateEmailAddressListOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **validateEmailAddressListOptions** | [**ValidateEmailAddressListOptions**](ValidateEmailAddressListOptions) | | + +### Return type + +[**ValidateEmailAddressListResult**](ValidateEmailAddressListResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/EmailVerificationResult.md b/docs/EmailVerificationResult.md new file mode 100644 index 00000000..1d19ccfe --- /dev/null +++ b/docs/EmailVerificationResult.md @@ -0,0 +1,14 @@ +# EmailVerificationResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domainName** | **String** | | +**port** | **Int** | | +**emailAddress** | **String** | | +**isValid** | **Bool** | | +**error** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmergencyAddress.md b/docs/EmergencyAddress.md new file mode 100644 index 00000000..cc1410f0 --- /dev/null +++ b/docs/EmergencyAddress.md @@ -0,0 +1,22 @@ +# EmergencyAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**sid** | **String** | | +**userId** | **UUID** | | +**displayName** | **String** | | +**customerName** | **String** | | +**address1** | **String** | | +**city** | **String** | | +**region** | **String** | | +**postalCode** | **String** | | +**phoneCountry** | **String** | | +**accountSid** | **String** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmergencyAddressDto.md b/docs/EmergencyAddressDto.md new file mode 100644 index 00000000..60a7af6c --- /dev/null +++ b/docs/EmergencyAddressDto.md @@ -0,0 +1,12 @@ +# EmergencyAddressDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**address1** | **String** | | +**phoneCountry** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/EmptyResponseDto.md b/docs/EmptyResponseDto.md new file mode 100644 index 00000000..a0f97538 --- /dev/null +++ b/docs/EmptyResponseDto.md @@ -0,0 +1,10 @@ +# EmptyResponseDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ExpirationDefaults.md b/docs/ExpirationDefaults.md new file mode 100644 index 00000000..0e6c9d9c --- /dev/null +++ b/docs/ExpirationDefaults.md @@ -0,0 +1,14 @@ +# ExpirationDefaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**defaultExpirationMillis** | **Int64** | | [optional] +**maxExpirationMillis** | **Int64** | | [optional] +**defaultExpiresAt** | **Date** | | [optional] +**canPermanentInbox** | **Bool** | | +**nextInboxAllowsPermanent** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ExpiredControllerAPI.md b/docs/ExpiredControllerAPI.md new file mode 100644 index 00000000..93e73c4a --- /dev/null +++ b/docs/ExpiredControllerAPI.md @@ -0,0 +1,204 @@ +# ExpiredControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getExpirationDefaults**](ExpiredControllerAPI#getexpirationdefaults) | **GET** /expired/defaults | Get default expiration settings +[**getExpiredInboxByInboxId**](ExpiredControllerAPI#getexpiredinboxbyinboxid) | **GET** /expired/inbox/{inboxId} | Get expired inbox record for a previously existing inbox +[**getExpiredInboxRecord**](ExpiredControllerAPI#getexpiredinboxrecord) | **GET** /expired/{expiredId} | Get an expired inbox record +[**getExpiredInboxes**](ExpiredControllerAPI#getexpiredinboxes) | **GET** /expired | List records of expired inboxes + + +# **getExpirationDefaults** +```swift + open class func getExpirationDefaults() -> Promise +``` + +Get default expiration settings + +Return default times used for inbox expiration + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get default expiration settings +ExpiredControllerAPI.getExpirationDefaults().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ExpirationDefaults**](ExpirationDefaults) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getExpiredInboxByInboxId** +```swift + open class func getExpiredInboxByInboxId( inboxId: UUID) -> Promise +``` + +Get expired inbox record for a previously existing inbox + +Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of inbox you want to retrieve (not the inbox ID) + +// Get expired inbox record for a previously existing inbox +ExpiredControllerAPI.getExpiredInboxByInboxId(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of inbox you want to retrieve (not the inbox ID) | + +### Return type + +[**ExpiredInboxDto**](ExpiredInboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getExpiredInboxRecord** +```swift + open class func getExpiredInboxRecord( expiredId: UUID) -> Promise +``` + +Get an expired inbox record + +Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let expiredId = 987 // UUID | ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId + +// Get an expired inbox record +ExpiredControllerAPI.getExpiredInboxRecord(expiredId: expiredId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **expiredId** | [**UUID**]() | ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId | + +### Return type + +[**ExpiredInboxDto**](ExpiredInboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getExpiredInboxes** +```swift + open class func getExpiredInboxes( page: Int? = nil, size: Int? = nil, sort: Sort_getExpiredInboxes? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List records of expired inboxes + +Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in inbox sent email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox sent email list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// List records of expired inboxes +ExpiredControllerAPI.getExpiredInboxes(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in inbox sent email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox sent email list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageExpiredInboxRecordProjection**](PageExpiredInboxRecordProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/ExpiredInboxDto.md b/docs/ExpiredInboxDto.md new file mode 100644 index 00000000..7aed6eca --- /dev/null +++ b/docs/ExpiredInboxDto.md @@ -0,0 +1,12 @@ +# ExpiredInboxDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**inboxId** | **UUID** | | +**emailAddress** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ExpiredInboxRecordProjection.md b/docs/ExpiredInboxRecordProjection.md new file mode 100644 index 00000000..c57bab2d --- /dev/null +++ b/docs/ExpiredInboxRecordProjection.md @@ -0,0 +1,13 @@ +# ExpiredInboxRecordProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**emailAddress** | **String** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ExportControllerAPI.md b/docs/ExportControllerAPI.md new file mode 100644 index 00000000..76a4fc68 --- /dev/null +++ b/docs/ExportControllerAPI.md @@ -0,0 +1,118 @@ +# ExportControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**exportEntities**](ExportControllerAPI#exportentities) | **GET** /export | Export inboxes link callable via browser +[**getExportLink**](ExportControllerAPI#getexportlink) | **POST** /export | Get export link + + +# **exportEntities** +```swift + open class func exportEntities( exportType: ExportType_exportEntities, apiKey: String, outputFormat: OutputFormat_exportEntities, filter: String? = nil, listSeparatorToken: String? = nil, excludePreviouslyExported: Bool? = nil, createdEarliestTime: Date? = nil, createdOldestTime: Date? = nil) -> Promise<[Data]> +``` + +Export inboxes link callable via browser + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let exportType = "exportType_example" // String | +let apiKey = "apiKey_example" // String | +let outputFormat = "outputFormat_example" // String | +let filter = "filter_example" // String | (optional) +let listSeparatorToken = "listSeparatorToken_example" // String | (optional) +let excludePreviouslyExported = true // Bool | (optional) +let createdEarliestTime = Date() // Date | (optional) +let createdOldestTime = Date() // Date | (optional) + +// Export inboxes link callable via browser +ExportControllerAPI.exportEntities(exportType: exportType, apiKey: apiKey, outputFormat: outputFormat, filter: filter, listSeparatorToken: listSeparatorToken, excludePreviouslyExported: excludePreviouslyExported, createdEarliestTime: createdEarliestTime, createdOldestTime: createdOldestTime).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exportType** | **String** | | + **apiKey** | **String** | | + **outputFormat** | **String** | | + **filter** | **String** | | [optional] + **listSeparatorToken** | **String** | | [optional] + **excludePreviouslyExported** | **Bool** | | [optional] + **createdEarliestTime** | **Date** | | [optional] + **createdOldestTime** | **Date** | | [optional] + +### Return type + +**[Data]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getExportLink** +```swift + open class func getExportLink( exportType: ExportType_getExportLink, exportOptions: ExportOptions, apiKey: String? = nil) -> Promise +``` + +Get export link + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let exportType = "exportType_example" // String | +let exportOptions = ExportOptions(outputFormat: "outputFormat_example", excludePreviouslyExported: false, createdEarliestTime: Date(), createdOldestTime: Date(), filter: "filter_example", listSeparatorToken: "listSeparatorToken_example") // ExportOptions | +let apiKey = "apiKey_example" // String | (optional) + +// Get export link +ExportControllerAPI.getExportLink(exportType: exportType, exportOptions: exportOptions, apiKey: apiKey).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exportType** | **String** | | + **exportOptions** | [**ExportOptions**](ExportOptions) | | + **apiKey** | **String** | | [optional] + +### Return type + +[**ExportLink**](ExportLink) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/ExportLink.md b/docs/ExportLink.md new file mode 100644 index 00000000..a07b4595 --- /dev/null +++ b/docs/ExportLink.md @@ -0,0 +1,10 @@ +# ExportLink + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**downloadLink** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ExportOptions.md b/docs/ExportOptions.md new file mode 100644 index 00000000..93f60f2b --- /dev/null +++ b/docs/ExportOptions.md @@ -0,0 +1,15 @@ +# ExportOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outputFormat** | **String** | | +**excludePreviouslyExported** | **Bool** | | [optional] +**createdEarliestTime** | **Date** | | [optional] +**createdOldestTime** | **Date** | | [optional] +**filter** | **String** | | [optional] +**listSeparatorToken** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/FilterBouncedRecipientsOptions.md b/docs/FilterBouncedRecipientsOptions.md new file mode 100644 index 00000000..6df6cfab --- /dev/null +++ b/docs/FilterBouncedRecipientsOptions.md @@ -0,0 +1,10 @@ +# FilterBouncedRecipientsOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emailRecipients** | **[String]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/FilterBouncedRecipientsResult.md b/docs/FilterBouncedRecipientsResult.md new file mode 100644 index 00000000..ffe8d615 --- /dev/null +++ b/docs/FilterBouncedRecipientsResult.md @@ -0,0 +1,10 @@ +# FilterBouncedRecipientsResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filteredRecipients** | **[String]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/FlushExpiredInboxesResult.md b/docs/FlushExpiredInboxesResult.md new file mode 100644 index 00000000..854d7c0e --- /dev/null +++ b/docs/FlushExpiredInboxesResult.md @@ -0,0 +1,11 @@ +# FlushExpiredInboxesResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxIds** | **[UUID]** | Inbox IDs affected by expiration | +**expireBefore** | **Date** | DateTime to filter inboxes so that those expiring before this time are expired | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/FormControllerAPI.md b/docs/FormControllerAPI.md new file mode 100644 index 00000000..d96ade9d --- /dev/null +++ b/docs/FormControllerAPI.md @@ -0,0 +1,68 @@ +# FormControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**submitForm**](FormControllerAPI#submitform) | **POST** /forms | Submit a form to be parsed and sent as an email to an address determined by the form fields + + +# **submitForm** +```swift + open class func submitForm( to: String? = nil, subject: String? = nil, redirectTo: String? = nil, emailAddress: String? = nil, successMessage: String? = nil, spamCheck: String? = nil, otherParameters: String? = nil) -> Promise +``` + +Submit a form to be parsed and sent as an email to an address determined by the form fields + +This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html
``` #### URL Example ```html
``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `
`. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let to = "to_example" // String | The email address that submitted form should be sent to. (optional) +let subject = "subject_example" // String | Optional subject of the email that will be sent. (optional) +let redirectTo = "redirectTo_example" // String | Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) +let emailAddress = "emailAddress_example" // String | Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) +let successMessage = "successMessage_example" // String | Optional success message to display if no _redirectTo present. (optional) +let spamCheck = "spamCheck_example" // String | Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) +let otherParameters = "otherParameters_example" // String | All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) + +// Submit a form to be parsed and sent as an email to an address determined by the form fields +FormControllerAPI.submitForm(to: to, subject: subject, redirectTo: redirectTo, emailAddress: emailAddress, successMessage: successMessage, spamCheck: spamCheck, otherParameters: otherParameters).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **to** | **String** | The email address that submitted form should be sent to. | [optional] + **subject** | **String** | Optional subject of the email that will be sent. | [optional] + **redirectTo** | **String** | Optional URL to redirect form submitter to after submission. If not present user will see a success message. | [optional] + **emailAddress** | **String** | Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. | [optional] + **successMessage** | **String** | Optional success message to display if no _redirectTo present. | [optional] + **spamCheck** | **String** | Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. | [optional] + **otherParameters** | **String** | All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. | [optional] + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/ForwardEmailOptions.md b/docs/ForwardEmailOptions.md new file mode 100644 index 00000000..25c5d10f --- /dev/null +++ b/docs/ForwardEmailOptions.md @@ -0,0 +1,15 @@ +# ForwardEmailOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to** | **[String]** | To recipients for forwarded email | +**subject** | **String** | Subject for forwarded email | [optional] +**cc** | **[String]** | Optional cc recipients | [optional] +**bcc** | **[String]** | Optional bcc recipients | [optional] +**from** | **String** | Optional from override | [optional] +**useInboxName** | **Bool** | Optionally use inbox name as display name for sender email address | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/GravatarUrl.md b/docs/GravatarUrl.md new file mode 100644 index 00000000..5b9d3b5f --- /dev/null +++ b/docs/GravatarUrl.md @@ -0,0 +1,11 @@ +# GravatarUrl + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **String** | | +**_hash** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/GroupContactsDto.md b/docs/GroupContactsDto.md new file mode 100644 index 00000000..85a6ca4e --- /dev/null +++ b/docs/GroupContactsDto.md @@ -0,0 +1,11 @@ +# GroupContactsDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | [**GroupDto**](GroupDto) | | +**contacts** | [ContactDto] | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/GroupControllerAPI.md b/docs/GroupControllerAPI.md new file mode 100644 index 00000000..e57e12cb --- /dev/null +++ b/docs/GroupControllerAPI.md @@ -0,0 +1,441 @@ +# GroupControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addContactsToGroup**](GroupControllerAPI#addcontactstogroup) | **PUT** /groups/{groupId}/contacts | Add contacts to a group +[**createGroup**](GroupControllerAPI#creategroup) | **POST** /groups | Create a group +[**deleteGroup**](GroupControllerAPI#deletegroup) | **DELETE** /groups/{groupId} | Delete group +[**getAllGroups**](GroupControllerAPI#getallgroups) | **GET** /groups/paginated | Get all Contact Groups in paginated format +[**getGroup**](GroupControllerAPI#getgroup) | **GET** /groups/{groupId} | Get group +[**getGroupWithContacts**](GroupControllerAPI#getgroupwithcontacts) | **GET** /groups/{groupId}/contacts | Get group and contacts belonging to it +[**getGroupWithContactsPaginated**](GroupControllerAPI#getgroupwithcontactspaginated) | **GET** /groups/{groupId}/contacts-paginated | +[**getGroups**](GroupControllerAPI#getgroups) | **GET** /groups | Get all groups +[**removeContactsFromGroup**](GroupControllerAPI#removecontactsfromgroup) | **DELETE** /groups/{groupId}/contacts | Remove contacts from a group + + +# **addContactsToGroup** +```swift + open class func addContactsToGroup( groupId: UUID, updateGroupContacts: UpdateGroupContacts) -> Promise +``` + +Add contacts to a group + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let groupId = 987 // UUID | +let updateGroupContacts = UpdateGroupContacts(contactIds: [123]) // UpdateGroupContacts | + +// Add contacts to a group +GroupControllerAPI.addContactsToGroup(groupId: groupId, updateGroupContacts: updateGroupContacts).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | [**UUID**]() | | + **updateGroupContacts** | [**UpdateGroupContacts**](UpdateGroupContacts) | | + +### Return type + +[**GroupContactsDto**](GroupContactsDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createGroup** +```swift + open class func createGroup( createGroupOptions: CreateGroupOptions) -> Promise +``` + +Create a group + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createGroupOptions = CreateGroupOptions(name: "name_example", _description: "_description_example") // CreateGroupOptions | + +// Create a group +GroupControllerAPI.createGroup(createGroupOptions: createGroupOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createGroupOptions** | [**CreateGroupOptions**](CreateGroupOptions) | | + +### Return type + +[**GroupDto**](GroupDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteGroup** +```swift + open class func deleteGroup( groupId: UUID) -> Promise +``` + +Delete group + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let groupId = 987 // UUID | + +// Delete group +GroupControllerAPI.deleteGroup(groupId: groupId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllGroups** +```swift + open class func getAllGroups( page: Int? = nil, size: Int? = nil, sort: Sort_getAllGroups? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all Contact Groups in paginated format + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get all Contact Groups in paginated format +GroupControllerAPI.getAllGroups(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageGroupProjection**](PageGroupProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getGroup** +```swift + open class func getGroup( groupId: UUID) -> Promise +``` + +Get group + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let groupId = 987 // UUID | + +// Get group +GroupControllerAPI.getGroup(groupId: groupId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | [**UUID**]() | | + +### Return type + +[**GroupDto**](GroupDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getGroupWithContacts** +```swift + open class func getGroupWithContacts( groupId: UUID) -> Promise +``` + +Get group and contacts belonging to it + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let groupId = 987 // UUID | + +// Get group and contacts belonging to it +GroupControllerAPI.getGroupWithContacts(groupId: groupId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | [**UUID**]() | | + +### Return type + +[**GroupContactsDto**](GroupContactsDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getGroupWithContactsPaginated** +```swift + open class func getGroupWithContactsPaginated( groupId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getGroupWithContactsPaginated? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get group and paginated contacts belonging to it + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let groupId = 987 // UUID | +let page = 987 // Int | Optional page index in group contact pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in group contact pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +GroupControllerAPI.getGroupWithContactsPaginated(groupId: groupId, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | [**UUID**]() | | + **page** | **Int** | Optional page index in group contact pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in group contact pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageContactProjection**](PageContactProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getGroups** +```swift + open class func getGroups() -> Promise<[GroupProjection]> +``` + +Get all groups + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get all groups +GroupControllerAPI.getGroups().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[GroupProjection]**](GroupProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **removeContactsFromGroup** +```swift + open class func removeContactsFromGroup( groupId: UUID, updateGroupContacts: UpdateGroupContacts) -> Promise +``` + +Remove contacts from a group + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let groupId = 987 // UUID | +let updateGroupContacts = UpdateGroupContacts(contactIds: [123]) // UpdateGroupContacts | + +// Remove contacts from a group +GroupControllerAPI.removeContactsFromGroup(groupId: groupId, updateGroupContacts: updateGroupContacts).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | [**UUID**]() | | + **updateGroupContacts** | [**UpdateGroupContacts**](UpdateGroupContacts) | | + +### Return type + +[**GroupContactsDto**](GroupContactsDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/GroupDto.md b/docs/GroupDto.md new file mode 100644 index 00000000..69aba297 --- /dev/null +++ b/docs/GroupDto.md @@ -0,0 +1,13 @@ +# GroupDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**name** | **String** | | +**_description** | **String** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/GroupProjection.md b/docs/GroupProjection.md new file mode 100644 index 00000000..11ebbb56 --- /dev/null +++ b/docs/GroupProjection.md @@ -0,0 +1,13 @@ +# GroupProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**_id** | **UUID** | | +**_description** | **String** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/HTMLValidationResult.md b/docs/HTMLValidationResult.md new file mode 100644 index 00000000..9f5857b0 --- /dev/null +++ b/docs/HTMLValidationResult.md @@ -0,0 +1,12 @@ +# HTMLValidationResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isValid** | **Bool** | Is HTML validation result valid | +**errors** | [ValidationMessage] | Optional errors resulting from HTML validation | +**warnings** | [ValidationMessage] | Optional warnings resulting from HTML validation | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/IPAddressResult.md b/docs/IPAddressResult.md new file mode 100644 index 00000000..ad0fdfbb --- /dev/null +++ b/docs/IPAddressResult.md @@ -0,0 +1,11 @@ +# IPAddressResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **String** | | +**hostname** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ImapFlagOperationOptions.md b/docs/ImapFlagOperationOptions.md new file mode 100644 index 00000000..8626e214 --- /dev/null +++ b/docs/ImapFlagOperationOptions.md @@ -0,0 +1,11 @@ +# ImapFlagOperationOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**flagOperation** | **String** | | +**flags** | **[String]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ImapSmtpAccessDetails.md b/docs/ImapSmtpAccessDetails.md new file mode 100644 index 00000000..927b2610 --- /dev/null +++ b/docs/ImapSmtpAccessDetails.md @@ -0,0 +1,17 @@ +# ImapSmtpAccessDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smtpServerHost** | **String** | SMTP server host domain | +**smtpServerPort** | **Int** | SMTP server host port | +**smtpUsername** | **String** | SMTP username for login | +**smtpPassword** | **String** | SMTP for login | +**imapServerHost** | **String** | IMAP server host domain | +**imapServerPort** | **Int** | IMAP server host port | +**imapUsername** | **String** | IMAP username for login | +**imapPassword** | **String** | IMAP password for login | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxByEmailAddressResult.md b/docs/InboxByEmailAddressResult.md new file mode 100644 index 00000000..733ac7a0 --- /dev/null +++ b/docs/InboxByEmailAddressResult.md @@ -0,0 +1,11 @@ +# InboxByEmailAddressResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxId** | **UUID** | | [optional] +**exists** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxByNameResult.md b/docs/InboxByNameResult.md new file mode 100644 index 00000000..1b2cb604 --- /dev/null +++ b/docs/InboxByNameResult.md @@ -0,0 +1,11 @@ +# InboxByNameResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxId** | **UUID** | | [optional] +**exists** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxControllerAPI.md b/docs/InboxControllerAPI.md new file mode 100644 index 00000000..4c1bc08f --- /dev/null +++ b/docs/InboxControllerAPI.md @@ -0,0 +1,1760 @@ +# InboxControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createInbox**](InboxControllerAPI#createinbox) | **POST** /inboxes | Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. +[**createInboxRuleset**](InboxControllerAPI#createinboxruleset) | **POST** /inboxes/{inboxId}/rulesets | Create an inbox ruleset +[**createInboxWithDefaults**](InboxControllerAPI#createinboxwithdefaults) | **POST** /inboxes/withDefaults | Create an inbox with default options. Uses MailSlurp domain pool address and is private. +[**createInboxWithOptions**](InboxControllerAPI#createinboxwithoptions) | **POST** /inboxes/withOptions | Create an inbox with options. Extended options for inbox creation. +[**deleteAllInboxEmails**](InboxControllerAPI#deleteallinboxemails) | **DELETE** /inboxes/{inboxId}/deleteAllInboxEmails | Delete all emails in a given inboxes. +[**deleteAllInboxes**](InboxControllerAPI#deleteallinboxes) | **DELETE** /inboxes | Delete all inboxes +[**deleteInbox**](InboxControllerAPI#deleteinbox) | **DELETE** /inboxes/{inboxId} | Delete inbox +[**doesInboxExist**](InboxControllerAPI#doesinboxexist) | **GET** /inboxes/exists | Does inbox exist +[**flushExpired**](InboxControllerAPI#flushexpired) | **DELETE** /inboxes/expired | Remove expired inboxes +[**getAllInboxes**](InboxControllerAPI#getallinboxes) | **GET** /inboxes/paginated | List All Inboxes Paginated +[**getDeliveryStatusesByInboxId**](InboxControllerAPI#getdeliverystatusesbyinboxid) | **GET** /inboxes/{inboxId}/delivery-status | +[**getEmails**](InboxControllerAPI#getemails) | **GET** /inboxes/{inboxId}/emails | Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. +[**getImapSmtpAccess**](InboxControllerAPI#getimapsmtpaccess) | **GET** /inboxes/imap-smtp-access | +[**getInbox**](InboxControllerAPI#getinbox) | **GET** /inboxes/{inboxId} | Get Inbox. Returns properties of an inbox. +[**getInboxByEmailAddress**](InboxControllerAPI#getinboxbyemailaddress) | **GET** /inboxes/byEmailAddress | Search for an inbox with the provided email address +[**getInboxByName**](InboxControllerAPI#getinboxbyname) | **GET** /inboxes/byName | Search for an inbox with the given name +[**getInboxCount**](InboxControllerAPI#getinboxcount) | **GET** /inboxes/count | Get total inbox count +[**getInboxEmailCount**](InboxControllerAPI#getinboxemailcount) | **GET** /inboxes/{inboxId}/emails/count | Get email count in inbox +[**getInboxEmailsPaginated**](InboxControllerAPI#getinboxemailspaginated) | **GET** /inboxes/{inboxId}/emails/paginated | Get inbox emails paginated +[**getInboxIds**](InboxControllerAPI#getinboxids) | **GET** /inboxes/ids | Get all inbox IDs +[**getInboxSentEmails**](InboxControllerAPI#getinboxsentemails) | **GET** /inboxes/{inboxId}/sent | Get Inbox Sent Emails +[**getInboxTags**](InboxControllerAPI#getinboxtags) | **GET** /inboxes/tags | Get inbox tags +[**getInboxes**](InboxControllerAPI#getinboxes) | **GET** /inboxes | List Inboxes and email addresses +[**getLatestEmailInInbox**](InboxControllerAPI#getlatestemailininbox) | **GET** /inboxes/getLatestEmail | Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. +[**getOrganizationInboxes**](InboxControllerAPI#getorganizationinboxes) | **GET** /inboxes/organization | List Organization Inboxes Paginated +[**listInboxRulesets**](InboxControllerAPI#listinboxrulesets) | **GET** /inboxes/{inboxId}/rulesets | List inbox rulesets +[**listInboxTrackingPixels**](InboxControllerAPI#listinboxtrackingpixels) | **GET** /inboxes/{inboxId}/tracking-pixels | List inbox tracking pixels +[**sendEmail**](InboxControllerAPI#sendemail) | **POST** /inboxes/{inboxId} | Send Email +[**sendEmailAndConfirm**](InboxControllerAPI#sendemailandconfirm) | **POST** /inboxes/{inboxId}/confirm | Send email and return sent confirmation +[**sendEmailWithQueue**](InboxControllerAPI#sendemailwithqueue) | **POST** /inboxes/{inboxId}/with-queue | Send email with queue +[**sendSmtpEnvelope**](InboxControllerAPI#sendsmtpenvelope) | **POST** /inboxes/{inboxId}/smtp-envelope | Send email using an SMTP mail envelope and message body and return sent confirmation +[**sendTestEmail**](InboxControllerAPI#sendtestemail) | **POST** /inboxes/{inboxId}/send-test-email | Send a test email to inbox +[**setInboxFavourited**](InboxControllerAPI#setinboxfavourited) | **PUT** /inboxes/{inboxId}/favourite | Set inbox favourited state +[**updateInbox**](InboxControllerAPI#updateinbox) | **PATCH** /inboxes/{inboxId} | Update Inbox. Change name and description. Email address is not editable. + + +# **createInbox** +```swift + open class func createInbox( emailAddress: String? = nil, tags: [String]? = nil, name: String? = nil, _description: String? = nil, useDomainPool: Bool? = nil, favourite: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, allowTeamAccess: Bool? = nil, inboxType: InboxType_createInbox? = nil, virtualInbox: Bool? = nil) -> Promise +``` + +Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. + +Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailAddress = "emailAddress_example" // String | A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional) +let tags = ["inner_example"] // [String] | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional) +let name = "name_example" // String | Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional) +let _description = "_description_example" // String | Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional) +let useDomainPool = true // Bool | Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional) +let favourite = true // Bool | Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional) +let expiresAt = Date() // Date | Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional) +let expiresIn = 987 // Int64 | Number of milliseconds that inbox should exist for (optional) +let allowTeamAccess = true // Bool | DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional) +let inboxType = "inboxType_example" // String | HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional) +let virtualInbox = true // Bool | Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional) + +// Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. +InboxControllerAPI.createInbox(emailAddress: emailAddress, tags: tags, name: name, _description: _description, useDomainPool: useDomainPool, favourite: favourite, expiresAt: expiresAt, expiresIn: expiresIn, allowTeamAccess: allowTeamAccess, inboxType: inboxType, virtualInbox: virtualInbox).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailAddress** | **String** | A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. | [optional] + **tags** | [**[String]**](String) | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. | [optional] + **name** | **String** | Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. | [optional] + **_description** | **String** | Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with | [optional] + **useDomainPool** | **Bool** | Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. | [optional] + **favourite** | **Bool** | Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering | [optional] + **expiresAt** | **Date** | Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. | [optional] + **expiresIn** | **Int64** | Number of milliseconds that inbox should exist for | [optional] + **allowTeamAccess** | **Bool** | DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. | [optional] + **inboxType** | **String** | HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. | [optional] + **virtualInbox** | **Bool** | Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. | [optional] + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createInboxRuleset** +```swift + open class func createInboxRuleset( inboxId: UUID, createInboxRulesetOptions: CreateInboxRulesetOptions) -> Promise +``` + +Create an inbox ruleset + +Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | inboxId +let createInboxRulesetOptions = CreateInboxRulesetOptions(scope: "scope_example", action: "action_example", target: "target_example") // CreateInboxRulesetOptions | + +// Create an inbox ruleset +InboxControllerAPI.createInboxRuleset(inboxId: inboxId, createInboxRulesetOptions: createInboxRulesetOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | inboxId | + **createInboxRulesetOptions** | [**CreateInboxRulesetOptions**](CreateInboxRulesetOptions) | | + +### Return type + +[**InboxRulesetDto**](InboxRulesetDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createInboxWithDefaults** +```swift + open class func createInboxWithDefaults() -> Promise +``` + +Create an inbox with default options. Uses MailSlurp domain pool address and is private. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Create an inbox with default options. Uses MailSlurp domain pool address and is private. +InboxControllerAPI.createInboxWithDefaults().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createInboxWithOptions** +```swift + open class func createInboxWithOptions( createInboxDto: CreateInboxDto) -> Promise +``` + +Create an inbox with options. Extended options for inbox creation. + +Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createInboxDto = CreateInboxDto(emailAddress: "emailAddress_example", name: "name_example", _description: "_description_example", useDomainPool: false, tags: ["tags_example"], expiresAt: Date(), favourite: false, expiresIn: 123, allowTeamAccess: false, inboxType: "inboxType_example", virtualInbox: false) // CreateInboxDto | + +// Create an inbox with options. Extended options for inbox creation. +InboxControllerAPI.createInboxWithOptions(createInboxDto: createInboxDto).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createInboxDto** | [**CreateInboxDto**](CreateInboxDto) | | + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteAllInboxEmails** +```swift + open class func deleteAllInboxEmails( inboxId: UUID) -> Promise +``` + +Delete all emails in a given inboxes. + +Deletes all emails in an inbox. Be careful as emails cannot be recovered + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Delete all emails in a given inboxes. +InboxControllerAPI.deleteAllInboxEmails(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteAllInboxes** +```swift + open class func deleteAllInboxes() -> Promise +``` + +Delete all inboxes + +Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Delete all inboxes +InboxControllerAPI.deleteAllInboxes().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteInbox** +```swift + open class func deleteInbox( inboxId: UUID) -> Promise +``` + +Delete inbox + +Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Delete inbox +InboxControllerAPI.deleteInbox(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **doesInboxExist** +```swift + open class func doesInboxExist( emailAddress: String) -> Promise +``` + +Does inbox exist + +Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailAddress = "emailAddress_example" // String | Email address + +// Does inbox exist +InboxControllerAPI.doesInboxExist(emailAddress: emailAddress).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailAddress** | **String** | Email address | + +### Return type + +[**InboxExistsDto**](InboxExistsDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **flushExpired** +```swift + open class func flushExpired( before: Date? = nil) -> Promise +``` + +Remove expired inboxes + +Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let before = Date() // Date | Optional expired at before flag to flush expired inboxes that have expired before the given time (optional) + +// Remove expired inboxes +InboxControllerAPI.flushExpired(before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **before** | **Date** | Optional expired at before flag to flush expired inboxes that have expired before the given time | [optional] + +### Return type + +[**FlushExpiredInboxesResult**](FlushExpiredInboxesResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllInboxes** +```swift + open class func getAllInboxes( page: Int? = nil, size: Int? = nil, sort: Sort_getAllInboxes? = nil, favourite: Bool? = nil, search: String? = nil, tag: String? = nil, teamAccess: Bool? = nil, since: Date? = nil, before: Date? = nil, inboxType: InboxType_getAllInboxes? = nil, domainId: UUID? = nil) -> Promise +``` + +List All Inboxes Paginated + +List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let favourite = true // Bool | Optionally filter results for favourites only (optional) (default to false) +let search = "search_example" // String | Optionally filter by search words partial matching ID, tags, name, and email address (optional) +let tag = "tag_example" // String | Optionally filter by tags. Will return inboxes that include given tags (optional) +let teamAccess = true // Bool | DEPRECATED. Optionally filter by team access. (optional) +let since = Date() // Date | Optional filter by created after given date time (optional) +let before = Date() // Date | Optional filter by created before given date time (optional) +let inboxType = "inboxType_example" // String | Optional filter by inbox type (optional) +let domainId = 987 // UUID | Optional domain ID filter (optional) + +// List All Inboxes Paginated +InboxControllerAPI.getAllInboxes(page: page, size: size, sort: sort, favourite: favourite, search: search, tag: tag, teamAccess: teamAccess, since: since, before: before, inboxType: inboxType, domainId: domainId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **favourite** | **Bool** | Optionally filter results for favourites only | [optional] [default to false] + **search** | **String** | Optionally filter by search words partial matching ID, tags, name, and email address | [optional] + **tag** | **String** | Optionally filter by tags. Will return inboxes that include given tags | [optional] + **teamAccess** | **Bool** | DEPRECATED. Optionally filter by team access. | [optional] + **since** | **Date** | Optional filter by created after given date time | [optional] + **before** | **Date** | Optional filter by created before given date time | [optional] + **inboxType** | **String** | Optional filter by inbox type | [optional] + **domainId** | [**UUID**]() | Optional domain ID filter | [optional] + +### Return type + +[**PageInboxProjection**](PageInboxProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getDeliveryStatusesByInboxId** +```swift + open class func getDeliveryStatusesByInboxId( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getDeliveryStatusesByInboxId? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get all email delivery statuses for an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let page = 987 // Int | Optional page index in delivery status list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in delivery status list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +InboxControllerAPI.getDeliveryStatusesByInboxId(inboxId: inboxId, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **page** | **Int** | Optional page index in delivery status list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in delivery status list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageDeliveryStatus**](PageDeliveryStatus) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmails** +```swift + open class func getEmails( inboxId: UUID, size: Int? = nil, limit: Int? = nil, sort: Sort_getEmails? = nil, retryTimeout: Int64? = nil, delayTimeout: Int64? = nil, minCount: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil) -> Promise<[EmailPreview]> +``` + +Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. + +List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of inbox that emails belongs to +let size = 987 // Int | Alias for limit. Assessed first before assessing any passed limit. (optional) +let limit = 987 // Int | Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional) +let sort = "sort_example" // String | Sort the results by received date and direction ASC or DESC (optional) +let retryTimeout = 987 // Int64 | Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional) +let delayTimeout = 987 // Int64 | (optional) +let minCount = 987 // Int64 | Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional) +let unreadOnly = true // Bool | (optional) +let before = Date() // Date | Exclude emails received after this ISO 8601 date time (optional) +let since = Date() // Date | Exclude emails received before this ISO 8601 date time (optional) + +// Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. +InboxControllerAPI.getEmails(inboxId: inboxId, size: size, limit: limit, sort: sort, retryTimeout: retryTimeout, delayTimeout: delayTimeout, minCount: minCount, unreadOnly: unreadOnly, before: before, since: since).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of inbox that emails belongs to | + **size** | **Int** | Alias for limit. Assessed first before assessing any passed limit. | [optional] + **limit** | **Int** | Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller | [optional] + **sort** | **String** | Sort the results by received date and direction ASC or DESC | [optional] + **retryTimeout** | **Int64** | Maximum milliseconds to spend retrying inbox database until minCount emails are returned | [optional] + **delayTimeout** | **Int64** | | [optional] + **minCount** | **Int64** | Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. | [optional] + **unreadOnly** | **Bool** | | [optional] + **before** | **Date** | Exclude emails received after this ISO 8601 date time | [optional] + **since** | **Date** | Exclude emails received before this ISO 8601 date time | [optional] + +### Return type + +[**[EmailPreview]**](EmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getImapSmtpAccess** +```swift + open class func getImapSmtpAccess( inboxId: UUID? = nil) -> Promise +``` + + + +Get IMAP and SMTP access usernames and passwords + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Inbox ID (optional) + +InboxControllerAPI.getImapSmtpAccess(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Inbox ID | [optional] + +### Return type + +[**ImapSmtpAccessDetails**](ImapSmtpAccessDetails) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInbox** +```swift + open class func getInbox( inboxId: UUID) -> Promise +``` + +Get Inbox. Returns properties of an inbox. + +Returns an inbox's properties, including its email address and ID. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Get Inbox. Returns properties of an inbox. +InboxControllerAPI.getInbox(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxByEmailAddress** +```swift + open class func getInboxByEmailAddress( emailAddress: String) -> Promise +``` + +Search for an inbox with the provided email address + +Get a inbox result by email address + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailAddress = "emailAddress_example" // String | + +// Search for an inbox with the provided email address +InboxControllerAPI.getInboxByEmailAddress(emailAddress: emailAddress).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailAddress** | **String** | | + +### Return type + +[**InboxByEmailAddressResult**](InboxByEmailAddressResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxByName** +```swift + open class func getInboxByName( name: String) -> Promise +``` + +Search for an inbox with the given name + +Get a inbox result by name + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let name = "name_example" // String | + +// Search for an inbox with the given name +InboxControllerAPI.getInboxByName(name: name).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String** | | + +### Return type + +[**InboxByNameResult**](InboxByNameResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxCount** +```swift + open class func getInboxCount() -> Promise +``` + +Get total inbox count + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get total inbox count +InboxControllerAPI.getInboxCount().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**CountDto**](CountDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxEmailCount** +```swift + open class func getInboxEmailCount( inboxId: UUID) -> Promise +``` + +Get email count in inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of inbox that emails belongs to + +// Get email count in inbox +InboxControllerAPI.getInboxEmailCount(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of inbox that emails belongs to | + +### Return type + +[**CountDto**](CountDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxEmailsPaginated** +```swift + open class func getInboxEmailsPaginated( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxEmailsPaginated? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get inbox emails paginated + +Get a paginated list of emails in an inbox. Does not hold connections open. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of inbox that emails belongs to +let page = 987 // Int | Optional page index in inbox emails list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox emails list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Optional filter by received after given date time (optional) +let before = Date() // Date | Optional filter by received before given date time (optional) + +// Get inbox emails paginated +InboxControllerAPI.getInboxEmailsPaginated(inboxId: inboxId, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of inbox that emails belongs to | + **page** | **Int** | Optional page index in inbox emails list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox emails list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Optional filter by received after given date time | [optional] + **before** | **Date** | Optional filter by received before given date time | [optional] + +### Return type + +[**PageEmailPreview**](PageEmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxIds** +```swift + open class func getInboxIds() -> Promise +``` + +Get all inbox IDs + +Get list of inbox IDs + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get all inbox IDs +InboxControllerAPI.getInboxIds().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InboxIdsResult**](InboxIdsResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxSentEmails** +```swift + open class func getInboxSentEmails( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxSentEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get Inbox Sent Emails + +Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let page = 987 // Int | Optional page index in inbox sent email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox sent email list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional sent email search (optional) +let since = Date() // Date | Optional filter by sent after given date time (optional) +let before = Date() // Date | Optional filter by sent before given date time (optional) + +// Get Inbox Sent Emails +InboxControllerAPI.getInboxSentEmails(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **page** | **Int** | Optional page index in inbox sent email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox sent email list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional sent email search | [optional] + **since** | **Date** | Optional filter by sent after given date time | [optional] + **before** | **Date** | Optional filter by sent before given date time | [optional] + +### Return type + +[**PageSentEmailProjection**](PageSentEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxTags** +```swift + open class func getInboxTags() -> Promise<[String]> +``` + +Get inbox tags + +Get all inbox tags + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get inbox tags +InboxControllerAPI.getInboxTags().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**[String]** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxes** +```swift + open class func getInboxes( size: Int? = nil, sort: Sort_getInboxes? = nil, since: Date? = nil, before: Date? = nil) -> Promise<[InboxDto]> +``` + +List Inboxes and email addresses + +List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using a limit and sort parameter. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let size = 987 // Int | Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional) (default to 100) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Optional filter by created after given date time (optional) +let before = Date() // Date | Optional filter by created before given date time (optional) + +// List Inboxes and email addresses +InboxControllerAPI.getInboxes(size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **size** | **Int** | Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. | [optional] [default to 100] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Optional filter by created after given date time | [optional] + **before** | **Date** | Optional filter by created before given date time | [optional] + +### Return type + +[**[InboxDto]**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getLatestEmailInInbox** +```swift + open class func getLatestEmailInInbox( inboxId: UUID, timeoutMillis: Int64) -> Promise +``` + +Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. + +Get the newest email in an inbox or wait for one to arrive + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to get the latest email from +let timeoutMillis = 987 // Int64 | Timeout milliseconds to wait for latest email + +// Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. +InboxControllerAPI.getLatestEmailInInbox(inboxId: inboxId, timeoutMillis: timeoutMillis).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to get the latest email from | + **timeoutMillis** | **Int64** | Timeout milliseconds to wait for latest email | + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getOrganizationInboxes** +```swift + open class func getOrganizationInboxes( page: Int? = nil, size: Int? = nil, sort: Sort_getOrganizationInboxes? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List Organization Inboxes Paginated + +List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Optional filter by created after given date time (optional) +let before = Date() // Date | Optional filter by created before given date time (optional) + +// List Organization Inboxes Paginated +InboxControllerAPI.getOrganizationInboxes(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Optional filter by created after given date time | [optional] + **before** | **Date** | Optional filter by created before given date time | [optional] + +### Return type + +[**PageOrganizationInboxProjection**](PageOrganizationInboxProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **listInboxRulesets** +```swift + open class func listInboxRulesets( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_listInboxRulesets? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List inbox rulesets + +List all rulesets attached to an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let page = 987 // Int | Optional page index in inbox ruleset list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox ruleset list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Optional filter by created after given date time (optional) +let before = Date() // Date | Optional filter by created before given date time (optional) + +// List inbox rulesets +InboxControllerAPI.listInboxRulesets(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **page** | **Int** | Optional page index in inbox ruleset list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox ruleset list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Optional filter by created after given date time | [optional] + **before** | **Date** | Optional filter by created before given date time | [optional] + +### Return type + +[**PageInboxRulesetDto**](PageInboxRulesetDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **listInboxTrackingPixels** +```swift + open class func listInboxTrackingPixels( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_listInboxTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List inbox tracking pixels + +List all tracking pixels sent from an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let page = 987 // Int | Optional page index in inbox tracking pixel list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox tracking pixel list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Optional filter by created after given date time (optional) +let before = Date() // Date | Optional filter by created before given date time (optional) + +// List inbox tracking pixels +InboxControllerAPI.listInboxTrackingPixels(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **page** | **Int** | Optional page index in inbox tracking pixel list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox tracking pixel list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Optional filter by created after given date time | [optional] + **before** | **Date** | Optional filter by created before given date time | [optional] + +### Return type + +[**PageTrackingPixelProjection**](PageTrackingPixelProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendEmail** +```swift + open class func sendEmail( inboxId: UUID, sendEmailOptions: SendEmailOptions) -> Promise +``` + +Send Email + +Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to send the email from +let sendEmailOptions = SendEmailOptions(toContacts: [123], toGroup: 123, to: ["to_example"], from: "from_example", cc: ["cc_example"], bcc: ["bcc_example"], subject: "subject_example", replyTo: "replyTo_example", body: "body_example", html: false, isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, addTrackingPixel: false, filterBouncedRecipients: false, validateEmailAddresses: "validateEmailAddresses_example") // SendEmailOptions | + +// Send Email +InboxControllerAPI.sendEmail(inboxId: inboxId, sendEmailOptions: sendEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to send the email from | + **sendEmailOptions** | [**SendEmailOptions**](SendEmailOptions) | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendEmailAndConfirm** +```swift + open class func sendEmailAndConfirm( inboxId: UUID, sendEmailOptions: SendEmailOptions) -> Promise +``` + +Send email and return sent confirmation + +Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to send the email from +let sendEmailOptions = SendEmailOptions(toContacts: [123], toGroup: 123, to: ["to_example"], from: "from_example", cc: ["cc_example"], bcc: ["bcc_example"], subject: "subject_example", replyTo: "replyTo_example", body: "body_example", html: false, isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, addTrackingPixel: false, filterBouncedRecipients: false, validateEmailAddresses: "validateEmailAddresses_example") // SendEmailOptions | + +// Send email and return sent confirmation +InboxControllerAPI.sendEmailAndConfirm(inboxId: inboxId, sendEmailOptions: sendEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to send the email from | + **sendEmailOptions** | [**SendEmailOptions**](SendEmailOptions) | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendEmailWithQueue** +```swift + open class func sendEmailWithQueue( inboxId: UUID, validateBeforeEnqueue: Bool, sendEmailOptions: SendEmailOptions) -> Promise +``` + +Send email with queue + +Send an email using a queue. Will place the email onto a queue that will then be processed and sent. Use this queue method to enable any failed email sending to be recovered. This will prevent lost emails when sending if your account encounters a block or payment issue. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to send the email from +let validateBeforeEnqueue = true // Bool | Validate before adding to queue +let sendEmailOptions = SendEmailOptions(toContacts: [123], toGroup: 123, to: ["to_example"], from: "from_example", cc: ["cc_example"], bcc: ["bcc_example"], subject: "subject_example", replyTo: "replyTo_example", body: "body_example", html: false, isHTML: false, charset: "charset_example", attachments: ["attachments_example"], templateVariables: "TODO", template: 123, sendStrategy: "sendStrategy_example", useInboxName: false, addTrackingPixel: false, filterBouncedRecipients: false, validateEmailAddresses: "validateEmailAddresses_example") // SendEmailOptions | + +// Send email with queue +InboxControllerAPI.sendEmailWithQueue(inboxId: inboxId, validateBeforeEnqueue: validateBeforeEnqueue, sendEmailOptions: sendEmailOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to send the email from | + **validateBeforeEnqueue** | **Bool** | Validate before adding to queue | + **sendEmailOptions** | [**SendEmailOptions**](SendEmailOptions) | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendSmtpEnvelope** +```swift + open class func sendSmtpEnvelope( inboxId: UUID, sendSMTPEnvelopeOptions: SendSMTPEnvelopeOptions) -> Promise +``` + +Send email using an SMTP mail envelope and message body and return sent confirmation + +Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of the inbox you want to send the email from +let sendSMTPEnvelopeOptions = SendSMTPEnvelopeOptions(rcptTo: ["rcptTo_example"], mailFrom: "mailFrom_example", data: "data_example") // SendSMTPEnvelopeOptions | + +// Send email using an SMTP mail envelope and message body and return sent confirmation +InboxControllerAPI.sendSmtpEnvelope(inboxId: inboxId, sendSMTPEnvelopeOptions: sendSMTPEnvelopeOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of the inbox you want to send the email from | + **sendSMTPEnvelopeOptions** | [**SendSMTPEnvelopeOptions**](SendSMTPEnvelopeOptions) | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendTestEmail** +```swift + open class func sendTestEmail( inboxId: UUID) -> Promise +``` + +Send a test email to inbox + +Send an inbox a test email to test email receiving is working + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Send a test email to inbox +InboxControllerAPI.sendTestEmail(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **setInboxFavourited** +```swift + open class func setInboxFavourited( inboxId: UUID, setInboxFavouritedOptions: SetInboxFavouritedOptions) -> Promise +``` + +Set inbox favourited state + +Set and return new favourite state for an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of inbox to set favourite state +let setInboxFavouritedOptions = SetInboxFavouritedOptions(state: false) // SetInboxFavouritedOptions | + +// Set inbox favourited state +InboxControllerAPI.setInboxFavourited(inboxId: inboxId, setInboxFavouritedOptions: setInboxFavouritedOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of inbox to set favourite state | + **setInboxFavouritedOptions** | [**SetInboxFavouritedOptions**](SetInboxFavouritedOptions) | | + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **updateInbox** +```swift + open class func updateInbox( inboxId: UUID, updateInboxOptions: UpdateInboxOptions) -> Promise +``` + +Update Inbox. Change name and description. Email address is not editable. + +Update editable fields on an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let updateInboxOptions = UpdateInboxOptions(name: "name_example", _description: "_description_example", tags: ["tags_example"], expiresAt: Date(), favourite: false) // UpdateInboxOptions | + +// Update Inbox. Change name and description. Email address is not editable. +InboxControllerAPI.updateInbox(inboxId: inboxId, updateInboxOptions: updateInboxOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **updateInboxOptions** | [**UpdateInboxOptions**](UpdateInboxOptions) | | + +### Return type + +[**InboxDto**](InboxDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/InboxDto.md b/docs/InboxDto.md new file mode 100644 index 00000000..a6a73415 --- /dev/null +++ b/docs/InboxDto.md @@ -0,0 +1,22 @@ +# InboxDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically. | +**userId** | **UUID** | ID of user that inbox belongs to | [optional] +**createdAt** | **Date** | When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`. | +**name** | **String** | Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search | [optional] +**domainId** | **UUID** | ID of custom domain used by the inbox if any | [optional] +**_description** | **String** | Description of an inbox for labelling and searching purposes | [optional] +**emailAddress** | **String** | The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. | +**expiresAt** | **String** | Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email. | [optional] +**favourite** | **Bool** | Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering | +**tags** | **[String]** | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. | [optional] +**inboxType** | **String** | Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). | [optional] +**readOnly** | **Bool** | Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes. | +**virtualInbox** | **Bool** | Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxExistsDto.md b/docs/InboxExistsDto.md new file mode 100644 index 00000000..7a09aaa5 --- /dev/null +++ b/docs/InboxExistsDto.md @@ -0,0 +1,10 @@ +# InboxExistsDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exists** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxForwarderControllerAPI.md b/docs/InboxForwarderControllerAPI.md new file mode 100644 index 00000000..ce414e6f --- /dev/null +++ b/docs/InboxForwarderControllerAPI.md @@ -0,0 +1,410 @@ +# InboxForwarderControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createNewInboxForwarder**](InboxForwarderControllerAPI#createnewinboxforwarder) | **POST** /forwarders | Create an inbox forwarder +[**deleteInboxForwarder**](InboxForwarderControllerAPI#deleteinboxforwarder) | **DELETE** /forwarders/{id} | Delete an inbox forwarder +[**deleteInboxForwarders**](InboxForwarderControllerAPI#deleteinboxforwarders) | **DELETE** /forwarders | Delete inbox forwarders +[**getInboxForwarder**](InboxForwarderControllerAPI#getinboxforwarder) | **GET** /forwarders/{id} | Get an inbox forwarder +[**getInboxForwarders**](InboxForwarderControllerAPI#getinboxforwarders) | **GET** /forwarders | List inbox forwarders +[**testInboxForwarder**](InboxForwarderControllerAPI#testinboxforwarder) | **POST** /forwarders/{id}/test | Test an inbox forwarder +[**testInboxForwardersForInbox**](InboxForwarderControllerAPI#testinboxforwardersforinbox) | **PUT** /forwarders | Test inbox forwarders for inbox +[**testNewInboxForwarder**](InboxForwarderControllerAPI#testnewinboxforwarder) | **PATCH** /forwarders | Test new inbox forwarder + + +# **createNewInboxForwarder** +```swift + open class func createNewInboxForwarder( inboxId: UUID, createInboxForwarderOptions: CreateInboxForwarderOptions) -> Promise +``` + +Create an inbox forwarder + +Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Inbox id to attach forwarder to +let createInboxForwarderOptions = CreateInboxForwarderOptions(field: "field_example", match: "match_example", forwardToRecipients: ["forwardToRecipients_example"]) // CreateInboxForwarderOptions | + +// Create an inbox forwarder +InboxForwarderControllerAPI.createNewInboxForwarder(inboxId: inboxId, createInboxForwarderOptions: createInboxForwarderOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Inbox id to attach forwarder to | + **createInboxForwarderOptions** | [**CreateInboxForwarderOptions**](CreateInboxForwarderOptions) | | + +### Return type + +[**InboxForwarderDto**](InboxForwarderDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteInboxForwarder** +```swift + open class func deleteInboxForwarder( _id: UUID) -> Promise +``` + +Delete an inbox forwarder + +Delete inbox forwarder + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of inbox forwarder + +// Delete an inbox forwarder +InboxForwarderControllerAPI.deleteInboxForwarder(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of inbox forwarder | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteInboxForwarders** +```swift + open class func deleteInboxForwarders( inboxId: UUID? = nil) -> Promise +``` + +Delete inbox forwarders + +Delete inbox forwarders. Accepts optional inboxId filter. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Optional inbox id to attach forwarder to (optional) + +// Delete inbox forwarders +InboxForwarderControllerAPI.deleteInboxForwarders(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Optional inbox id to attach forwarder to | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxForwarder** +```swift + open class func getInboxForwarder( _id: UUID) -> Promise +``` + +Get an inbox forwarder + +Get inbox ruleset + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of inbox forwarder + +// Get an inbox forwarder +InboxForwarderControllerAPI.getInboxForwarder(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of inbox forwarder | + +### Return type + +[**InboxForwarderDto**](InboxForwarderDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxForwarders** +```swift + open class func getInboxForwarders( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxForwarders? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List inbox forwarders + +List all forwarders attached to an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Optional inbox id to get forwarders from (optional) +let page = 987 // Int | Optional page index in inbox forwarder list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox forwarder list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// List inbox forwarders +InboxForwarderControllerAPI.getInboxForwarders(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Optional inbox id to get forwarders from | [optional] + **page** | **Int** | Optional page index in inbox forwarder list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox forwarder list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageInboxForwarderDto**](PageInboxForwarderDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testInboxForwarder** +```swift + open class func testInboxForwarder( _id: UUID, inboxForwarderTestOptions: InboxForwarderTestOptions) -> Promise +``` + +Test an inbox forwarder + +Test an inbox forwarder + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of inbox forwarder +let inboxForwarderTestOptions = InboxForwarderTestOptions(testValue: "testValue_example") // InboxForwarderTestOptions | + +// Test an inbox forwarder +InboxForwarderControllerAPI.testInboxForwarder(_id: _id, inboxForwarderTestOptions: inboxForwarderTestOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of inbox forwarder | + **inboxForwarderTestOptions** | [**InboxForwarderTestOptions**](InboxForwarderTestOptions) | | + +### Return type + +[**InboxForwarderTestResult**](InboxForwarderTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testInboxForwardersForInbox** +```swift + open class func testInboxForwardersForInbox( inboxId: UUID, inboxForwarderTestOptions: InboxForwarderTestOptions) -> Promise +``` + +Test inbox forwarders for inbox + +Test inbox forwarders for inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of inbox +let inboxForwarderTestOptions = InboxForwarderTestOptions(testValue: "testValue_example") // InboxForwarderTestOptions | + +// Test inbox forwarders for inbox +InboxForwarderControllerAPI.testInboxForwardersForInbox(inboxId: inboxId, inboxForwarderTestOptions: inboxForwarderTestOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of inbox | + **inboxForwarderTestOptions** | [**InboxForwarderTestOptions**](InboxForwarderTestOptions) | | + +### Return type + +[**InboxForwarderTestResult**](InboxForwarderTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testNewInboxForwarder** +```swift + open class func testNewInboxForwarder( testNewInboxForwarderOptions: TestNewInboxForwarderOptions) -> Promise +``` + +Test new inbox forwarder + +Test new inbox forwarder + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let testNewInboxForwarderOptions = TestNewInboxForwarderOptions(inboxForwarderTestOptions: InboxForwarderTestOptions(testValue: "testValue_example"), createInboxForwarderOptions: CreateInboxForwarderOptions(field: "field_example", match: "match_example", forwardToRecipients: ["forwardToRecipients_example"])) // TestNewInboxForwarderOptions | + +// Test new inbox forwarder +InboxForwarderControllerAPI.testNewInboxForwarder(testNewInboxForwarderOptions: testNewInboxForwarderOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testNewInboxForwarderOptions** | [**TestNewInboxForwarderOptions**](TestNewInboxForwarderOptions) | | + +### Return type + +[**InboxForwarderTestResult**](InboxForwarderTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/InboxForwarderDto.md b/docs/InboxForwarderDto.md new file mode 100644 index 00000000..d28191b8 --- /dev/null +++ b/docs/InboxForwarderDto.md @@ -0,0 +1,15 @@ +# InboxForwarderDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**inboxId** | **UUID** | | +**field** | **String** | | +**match** | **String** | | +**forwardToRecipients** | **[String]** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxForwarderTestOptions.md b/docs/InboxForwarderTestOptions.md new file mode 100644 index 00000000..804224fa --- /dev/null +++ b/docs/InboxForwarderTestOptions.md @@ -0,0 +1,10 @@ +# InboxForwarderTestOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**testValue** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxForwarderTestResult.md b/docs/InboxForwarderTestResult.md new file mode 100644 index 00000000..57bde808 --- /dev/null +++ b/docs/InboxForwarderTestResult.md @@ -0,0 +1,11 @@ +# InboxForwarderTestResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**matches** | **[String: Bool]** | | +**doesMatch** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxIdItem.md b/docs/InboxIdItem.md new file mode 100644 index 00000000..86ff464a --- /dev/null +++ b/docs/InboxIdItem.md @@ -0,0 +1,11 @@ +# InboxIdItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**emailAddress** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxIdsResult.md b/docs/InboxIdsResult.md new file mode 100644 index 00000000..e4d32958 --- /dev/null +++ b/docs/InboxIdsResult.md @@ -0,0 +1,10 @@ +# InboxIdsResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxIds** | [InboxIdItem] | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxPreview.md b/docs/InboxPreview.md new file mode 100644 index 00000000..1631c03f --- /dev/null +++ b/docs/InboxPreview.md @@ -0,0 +1,20 @@ +# InboxPreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically. | +**domainId** | **UUID** | ID of custom domain used by the inbox if any | [optional] +**emailAddress** | **String** | The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. | [optional] +**createdAt** | **Date** | When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`. | +**favourite** | **Bool** | Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering | +**name** | **String** | Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search | [optional] +**tags** | **[String]** | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. | [optional] +**teamAccess** | **Bool** | Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/ | +**inboxType** | **String** | Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). | [optional] +**virtualInbox** | **Bool** | Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions. | +**expiresAt** | **String** | Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email. | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxRulesetControllerAPI.md b/docs/InboxRulesetControllerAPI.md new file mode 100644 index 00000000..302fff8c --- /dev/null +++ b/docs/InboxRulesetControllerAPI.md @@ -0,0 +1,410 @@ +# InboxRulesetControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createNewInboxRuleset**](InboxRulesetControllerAPI#createnewinboxruleset) | **POST** /rulesets | Create an inbox ruleset +[**deleteInboxRuleset**](InboxRulesetControllerAPI#deleteinboxruleset) | **DELETE** /rulesets/{id} | Delete an inbox ruleset +[**deleteInboxRulesets**](InboxRulesetControllerAPI#deleteinboxrulesets) | **DELETE** /rulesets | Delete inbox rulesets +[**getInboxRuleset**](InboxRulesetControllerAPI#getinboxruleset) | **GET** /rulesets/{id} | Get an inbox ruleset +[**getInboxRulesets**](InboxRulesetControllerAPI#getinboxrulesets) | **GET** /rulesets | List inbox rulesets +[**testInboxRuleset**](InboxRulesetControllerAPI#testinboxruleset) | **POST** /rulesets/{id}/test | Test an inbox ruleset +[**testInboxRulesetsForInbox**](InboxRulesetControllerAPI#testinboxrulesetsforinbox) | **PUT** /rulesets | Test inbox rulesets for inbox +[**testNewInboxRuleset**](InboxRulesetControllerAPI#testnewinboxruleset) | **PATCH** /rulesets | Test new inbox ruleset + + +# **createNewInboxRuleset** +```swift + open class func createNewInboxRuleset( inboxId: UUID, createInboxRulesetOptions: CreateInboxRulesetOptions) -> Promise +``` + +Create an inbox ruleset + +Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Inbox id to attach ruleset to +let createInboxRulesetOptions = CreateInboxRulesetOptions(scope: "scope_example", action: "action_example", target: "target_example") // CreateInboxRulesetOptions | + +// Create an inbox ruleset +InboxRulesetControllerAPI.createNewInboxRuleset(inboxId: inboxId, createInboxRulesetOptions: createInboxRulesetOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Inbox id to attach ruleset to | + **createInboxRulesetOptions** | [**CreateInboxRulesetOptions**](CreateInboxRulesetOptions) | | + +### Return type + +[**InboxRulesetDto**](InboxRulesetDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteInboxRuleset** +```swift + open class func deleteInboxRuleset( _id: UUID) -> Promise +``` + +Delete an inbox ruleset + +Delete inbox ruleset + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of inbox ruleset + +// Delete an inbox ruleset +InboxRulesetControllerAPI.deleteInboxRuleset(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of inbox ruleset | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteInboxRulesets** +```swift + open class func deleteInboxRulesets( inboxId: UUID? = nil) -> Promise +``` + +Delete inbox rulesets + +Delete inbox rulesets. Accepts optional inboxId filter. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Optional inbox id to attach ruleset to (optional) + +// Delete inbox rulesets +InboxRulesetControllerAPI.deleteInboxRulesets(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Optional inbox id to attach ruleset to | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxRuleset** +```swift + open class func getInboxRuleset( _id: UUID) -> Promise +``` + +Get an inbox ruleset + +Get inbox ruleset + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of inbox ruleset + +// Get an inbox ruleset +InboxRulesetControllerAPI.getInboxRuleset(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of inbox ruleset | + +### Return type + +[**InboxRulesetDto**](InboxRulesetDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxRulesets** +```swift + open class func getInboxRulesets( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxRulesets? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List inbox rulesets + +List all rulesets attached to an inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Optional inbox id to get rulesets from (optional) +let page = 987 // Int | Optional page index in inbox ruleset list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox ruleset list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// List inbox rulesets +InboxRulesetControllerAPI.getInboxRulesets(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Optional inbox id to get rulesets from | [optional] + **page** | **Int** | Optional page index in inbox ruleset list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox ruleset list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageInboxRulesetDto**](PageInboxRulesetDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testInboxRuleset** +```swift + open class func testInboxRuleset( _id: UUID, inboxRulesetTestOptions: InboxRulesetTestOptions) -> Promise +``` + +Test an inbox ruleset + +Test an inbox ruleset + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | ID of inbox ruleset +let inboxRulesetTestOptions = InboxRulesetTestOptions(testTarget: "testTarget_example") // InboxRulesetTestOptions | + +// Test an inbox ruleset +InboxRulesetControllerAPI.testInboxRuleset(_id: _id, inboxRulesetTestOptions: inboxRulesetTestOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | ID of inbox ruleset | + **inboxRulesetTestOptions** | [**InboxRulesetTestOptions**](InboxRulesetTestOptions) | | + +### Return type + +[**InboxRulesetTestResult**](InboxRulesetTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testInboxRulesetsForInbox** +```swift + open class func testInboxRulesetsForInbox( inboxId: UUID, inboxRulesetTestOptions: InboxRulesetTestOptions) -> Promise +``` + +Test inbox rulesets for inbox + +Test inbox rulesets for inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | ID of inbox +let inboxRulesetTestOptions = InboxRulesetTestOptions(testTarget: "testTarget_example") // InboxRulesetTestOptions | + +// Test inbox rulesets for inbox +InboxRulesetControllerAPI.testInboxRulesetsForInbox(inboxId: inboxId, inboxRulesetTestOptions: inboxRulesetTestOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | ID of inbox | + **inboxRulesetTestOptions** | [**InboxRulesetTestOptions**](InboxRulesetTestOptions) | | + +### Return type + +[**InboxRulesetTestResult**](InboxRulesetTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testNewInboxRuleset** +```swift + open class func testNewInboxRuleset( testNewInboxRulesetOptions: TestNewInboxRulesetOptions) -> Promise +``` + +Test new inbox ruleset + +Test new inbox ruleset + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let testNewInboxRulesetOptions = TestNewInboxRulesetOptions(inboxRulesetTestOptions: InboxRulesetTestOptions(testTarget: "testTarget_example"), createInboxRulesetOptions: CreateInboxRulesetOptions(scope: "scope_example", action: "action_example", target: "target_example")) // TestNewInboxRulesetOptions | + +// Test new inbox ruleset +InboxRulesetControllerAPI.testNewInboxRuleset(testNewInboxRulesetOptions: testNewInboxRulesetOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testNewInboxRulesetOptions** | [**TestNewInboxRulesetOptions**](TestNewInboxRulesetOptions) | | + +### Return type + +[**InboxRulesetTestResult**](InboxRulesetTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/InboxRulesetDto.md b/docs/InboxRulesetDto.md new file mode 100644 index 00000000..4534eb91 --- /dev/null +++ b/docs/InboxRulesetDto.md @@ -0,0 +1,16 @@ +# InboxRulesetDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**inboxId** | **UUID** | | +**scope** | **String** | | +**action** | **String** | | +**target** | **String** | | +**handler** | **String** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxRulesetTestOptions.md b/docs/InboxRulesetTestOptions.md new file mode 100644 index 00000000..9e31a3db --- /dev/null +++ b/docs/InboxRulesetTestOptions.md @@ -0,0 +1,10 @@ +# InboxRulesetTestOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**testTarget** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InboxRulesetTestResult.md b/docs/InboxRulesetTestResult.md new file mode 100644 index 00000000..fa5f71f8 --- /dev/null +++ b/docs/InboxRulesetTestResult.md @@ -0,0 +1,11 @@ +# InboxRulesetTestResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rulesetMatches** | **[String: Bool]** | Map of inbox ruleset ID to boolean of if target matches | +**matches** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InlineObject.md b/docs/InlineObject.md new file mode 100644 index 00000000..93c7f7e1 --- /dev/null +++ b/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contentTypeHeader** | **String** | Optional content type header of attachment | [optional] +**file** | **URL** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/InlineObject1.md b/docs/InlineObject1.md new file mode 100644 index 00000000..5d077a23 --- /dev/null +++ b/docs/InlineObject1.md @@ -0,0 +1,17 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**short** | **Int** | | [optional] +**char** | **String** | | [optional] +**int** | **Int** | | [optional] +**long** | **Int64** | | [optional] +**float** | **Float** | | [optional] +**double** | **Double** | | [optional] +**direct** | **Bool** | | [optional] +**readOnly** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/JSONSchemaDto.md b/docs/JSONSchemaDto.md new file mode 100644 index 00000000..bb5996e2 --- /dev/null +++ b/docs/JSONSchemaDto.md @@ -0,0 +1,10 @@ +# JSONSchemaDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/MailServerControllerAPI.md b/docs/MailServerControllerAPI.md new file mode 100644 index 00000000..ab7e6749 --- /dev/null +++ b/docs/MailServerControllerAPI.md @@ -0,0 +1,192 @@ +# MailServerControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**describeMailServerDomain**](MailServerControllerAPI#describemailserverdomain) | **POST** /mail-server/describe/domain | Get DNS Mail Server records for a domain +[**getDnsLookup**](MailServerControllerAPI#getdnslookup) | **POST** /mail-server/describe/dns-lookup | Lookup DNS records for a domain +[**getIpAddress**](MailServerControllerAPI#getipaddress) | **POST** /mail-server/describe/ip-address | Get IP address for a domain +[**verifyEmailAddress**](MailServerControllerAPI#verifyemailaddress) | **POST** /mail-server/verify/email-address | Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server. + + +# **describeMailServerDomain** +```swift + open class func describeMailServerDomain( describeDomainOptions: DescribeDomainOptions) -> Promise +``` + +Get DNS Mail Server records for a domain + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let describeDomainOptions = DescribeDomainOptions(domain: "domain_example") // DescribeDomainOptions | + +// Get DNS Mail Server records for a domain +MailServerControllerAPI.describeMailServerDomain(describeDomainOptions: describeDomainOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **describeDomainOptions** | [**DescribeDomainOptions**](DescribeDomainOptions) | | + +### Return type + +[**DescribeMailServerDomainResult**](DescribeMailServerDomainResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getDnsLookup** +```swift + open class func getDnsLookup( dNSLookupOptions: DNSLookupOptions) -> Promise +``` + +Lookup DNS records for a domain + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let dNSLookupOptions = DNSLookupOptions(hostname: "hostname_example", recordTypes: ["recordTypes_example"], omitFinalDNSDot: false) // DNSLookupOptions | + +// Lookup DNS records for a domain +MailServerControllerAPI.getDnsLookup(dNSLookupOptions: dNSLookupOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dNSLookupOptions** | [**DNSLookupOptions**](DNSLookupOptions) | | + +### Return type + +[**DNSLookupResults**](DNSLookupResults) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getIpAddress** +```swift + open class func getIpAddress( name: String) -> Promise +``` + +Get IP address for a domain + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let name = "name_example" // String | + +// Get IP address for a domain +MailServerControllerAPI.getIpAddress(name: name).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String** | | + +### Return type + +[**IPAddressResult**](IPAddressResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **verifyEmailAddress** +```swift + open class func verifyEmailAddress( verifyEmailAddressOptions: VerifyEmailAddressOptions) -> Promise +``` + +Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let verifyEmailAddressOptions = VerifyEmailAddressOptions(mailServerDomain: "mailServerDomain_example", emailAddress: "emailAddress_example", senderEmailAddress: "senderEmailAddress_example", port: 123) // VerifyEmailAddressOptions | + +// Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server. +MailServerControllerAPI.verifyEmailAddress(verifyEmailAddressOptions: verifyEmailAddressOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **verifyEmailAddressOptions** | [**VerifyEmailAddressOptions**](VerifyEmailAddressOptions) | | + +### Return type + +[**EmailVerificationResult**](EmailVerificationResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/MatchOption.md b/docs/MatchOption.md new file mode 100644 index 00000000..17d8aa02 --- /dev/null +++ b/docs/MatchOption.md @@ -0,0 +1,12 @@ +# MatchOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **String** | Fields of an email object that can be used to filter results | +**should** | **String** | How the value of the email field specified should be compared to the value given in the match options. | +**value** | **String** | The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/MatchOptions.md b/docs/MatchOptions.md new file mode 100644 index 00000000..abe22da0 --- /dev/null +++ b/docs/MatchOptions.md @@ -0,0 +1,11 @@ +# MatchOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**matches** | [MatchOption] | Zero or more match options such as `{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }`. Options are additive so if one does not match the email is excluded from results | [optional] +**conditions** | [ConditionOption] | Zero or more conditions such as `{ condition: 'HAS_ATTACHMENTS', value: 'TRUE' }`. Note the values are the strings `TRUE|FALSE` not booleans. | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/MissedEmail.md b/docs/MissedEmail.md new file mode 100644 index 00000000..f3a4c0ba --- /dev/null +++ b/docs/MissedEmail.md @@ -0,0 +1,25 @@ +# MissedEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**userId** | **UUID** | | [optional] +**subject** | **String** | | [optional] +**bodyExcerpt** | **String** | | [optional] +**attachmentCount** | **Int** | | +**from** | **String** | | [optional] +**rawUrl** | **String** | | [optional] +**rawKey** | **String** | | [optional] +**rawBucket** | **String** | | [optional] +**canRestore** | **Bool** | | [optional] +**to** | **[String]** | | +**cc** | **[String]** | | +**bcc** | **[String]** | | +**inboxIds** | **[UUID]** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/MissedEmailControllerAPI.md b/docs/MissedEmailControllerAPI.md new file mode 100644 index 00000000..2f1d3904 --- /dev/null +++ b/docs/MissedEmailControllerAPI.md @@ -0,0 +1,274 @@ +# MissedEmailControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getAllMissedEmails**](MissedEmailControllerAPI#getallmissedemails) | **GET** /missed-emails | Get all MissedEmails in paginated format +[**getAllUnknownMissedEmails**](MissedEmailControllerAPI#getallunknownmissedemails) | **GET** /missed-emails/unknown | Get all unknown missed emails in paginated format +[**getMissedEmail**](MissedEmailControllerAPI#getmissedemail) | **GET** /missed-emails/{missedEmailId} | Get MissedEmail +[**restoreMissedEmails**](MissedEmailControllerAPI#restoremissedemails) | **POST** /missed-emails/restore | Restore missed emails +[**waitForNthMissedEmail**](MissedEmailControllerAPI#waitfornthmissedemail) | **GET** /missed-emails/waitForNthMissedEmail | Wait for Nth missed email + + +# **getAllMissedEmails** +```swift + open class func getAllMissedEmails( page: Int? = nil, size: Int? = nil, sort: Sort_getAllMissedEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, inboxId: UUID? = nil) -> Promise +``` + +Get all MissedEmails in paginated format + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) +let inboxId = 987 // UUID | Optional inbox ID filter (optional) + +// Get all MissedEmails in paginated format +MissedEmailControllerAPI.getAllMissedEmails(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + **inboxId** | [**UUID**]() | Optional inbox ID filter | [optional] + +### Return type + +[**PageMissedEmailProjection**](PageMissedEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllUnknownMissedEmails** +```swift + open class func getAllUnknownMissedEmails( page: Int? = nil, size: Int? = nil, sort: Sort_getAllUnknownMissedEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, inboxId: UUID? = nil) -> Promise +``` + +Get all unknown missed emails in paginated format + +Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) +let inboxId = 987 // UUID | Optional inbox ID filter (optional) + +// Get all unknown missed emails in paginated format +MissedEmailControllerAPI.getAllUnknownMissedEmails(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + **inboxId** | [**UUID**]() | Optional inbox ID filter | [optional] + +### Return type + +[**PageUnknownMissedEmailProjection**](PageUnknownMissedEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getMissedEmail** +```swift + open class func getMissedEmail( missedEmailId: UUID) -> Promise +``` + +Get MissedEmail + +List emails that were missed due to plan limits. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let missedEmailId = 987 // UUID | + +// Get MissedEmail +MissedEmailControllerAPI.getMissedEmail(missedEmailId: missedEmailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **missedEmailId** | [**UUID**]() | | + +### Return type + +[**MissedEmail**](MissedEmail) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **restoreMissedEmails** +```swift + open class func restoreMissedEmails() -> Promise +``` + +Restore missed emails + +If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Restore missed emails +MissedEmailControllerAPI.restoreMissedEmails().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForNthMissedEmail** +```swift + open class func waitForNthMissedEmail( index: Int, inboxId: UUID? = nil, timeout: Int64? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Wait for Nth missed email + +Wait for 0 based index missed email + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let index = 987 // Int | Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 +let inboxId = 987 // UUID | Optional inbox ID filter (optional) +let timeout = 987 // Int64 | Optional timeout milliseconds (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Wait for Nth missed email +MissedEmailControllerAPI.waitForNthMissedEmail(index: index, inboxId: inboxId, timeout: timeout, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **index** | **Int** | Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 | + **inboxId** | [**UUID**]() | Optional inbox ID filter | [optional] + **timeout** | **Int64** | Optional timeout milliseconds | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**MissedEmail**](MissedEmail) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/MissedEmailProjection.md b/docs/MissedEmailProjection.md new file mode 100644 index 00000000..51e26bf8 --- /dev/null +++ b/docs/MissedEmailProjection.md @@ -0,0 +1,14 @@ +# MissedEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**from** | **String** | | [optional] +**subject** | **String** | | [optional] +**userId** | **UUID** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/NameServerRecord.md b/docs/NameServerRecord.md new file mode 100644 index 00000000..3c619e3e --- /dev/null +++ b/docs/NameServerRecord.md @@ -0,0 +1,13 @@ +# NameServerRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raw** | **String** | | +**recordType** | **String** | | +**priority** | **String** | | +**value** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/OrganizationInboxProjection.md b/docs/OrganizationInboxProjection.md new file mode 100644 index 00000000..7a69cc3e --- /dev/null +++ b/docs/OrganizationInboxProjection.md @@ -0,0 +1,20 @@ +# OrganizationInboxProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically. | +**domainId** | **UUID** | ID of custom domain used by the inbox if any | [optional] +**createdAt** | **Date** | When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`. | +**name** | **String** | Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search | [optional] +**emailAddress** | **String** | The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. | [optional] +**favourite** | **Bool** | Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering | +**tags** | **[String]** | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. | [optional] +**teamAccess** | **Bool** | Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/ | +**inboxType** | **String** | Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). | [optional] +**readOnly** | **Bool** | Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes. | +**virtualInbox** | **Bool** | Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageAlias.md b/docs/PageAlias.md new file mode 100644 index 00000000..73872227 --- /dev/null +++ b/docs/PageAlias.md @@ -0,0 +1,21 @@ +# PageAlias + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [AliasProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageAttachmentEntity.md b/docs/PageAttachmentEntity.md new file mode 100644 index 00000000..31f353dc --- /dev/null +++ b/docs/PageAttachmentEntity.md @@ -0,0 +1,21 @@ +# PageAttachmentEntity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [AttachmentProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageBouncedEmail.md b/docs/PageBouncedEmail.md new file mode 100644 index 00000000..2a310237 --- /dev/null +++ b/docs/PageBouncedEmail.md @@ -0,0 +1,21 @@ +# PageBouncedEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [BounceProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageBouncedRecipients.md b/docs/PageBouncedRecipients.md new file mode 100644 index 00000000..27cc22b8 --- /dev/null +++ b/docs/PageBouncedRecipients.md @@ -0,0 +1,21 @@ +# PageBouncedRecipients + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [BounceRecipientProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageComplaint.md b/docs/PageComplaint.md new file mode 100644 index 00000000..dff046ac --- /dev/null +++ b/docs/PageComplaint.md @@ -0,0 +1,21 @@ +# PageComplaint + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [Complaint] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageContactProjection.md b/docs/PageContactProjection.md new file mode 100644 index 00000000..eb8f9fba --- /dev/null +++ b/docs/PageContactProjection.md @@ -0,0 +1,21 @@ +# PageContactProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [ContactProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageDeliveryStatus.md b/docs/PageDeliveryStatus.md new file mode 100644 index 00000000..17dff20b --- /dev/null +++ b/docs/PageDeliveryStatus.md @@ -0,0 +1,21 @@ +# PageDeliveryStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [DeliveryStatusDto] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageEmailPreview.md b/docs/PageEmailPreview.md new file mode 100644 index 00000000..203d566d --- /dev/null +++ b/docs/PageEmailPreview.md @@ -0,0 +1,21 @@ +# PageEmailPreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [EmailPreview] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageEmailProjection.md b/docs/PageEmailProjection.md new file mode 100644 index 00000000..5c2ec7eb --- /dev/null +++ b/docs/PageEmailProjection.md @@ -0,0 +1,21 @@ +# PageEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [EmailProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageEmailValidationRequest.md b/docs/PageEmailValidationRequest.md new file mode 100644 index 00000000..338d1f6e --- /dev/null +++ b/docs/PageEmailValidationRequest.md @@ -0,0 +1,21 @@ +# PageEmailValidationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [EmailValidationRequest] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageExpiredInboxRecordProjection.md b/docs/PageExpiredInboxRecordProjection.md new file mode 100644 index 00000000..8fc0bfe7 --- /dev/null +++ b/docs/PageExpiredInboxRecordProjection.md @@ -0,0 +1,21 @@ +# PageExpiredInboxRecordProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [ExpiredInboxRecordProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageGroupProjection.md b/docs/PageGroupProjection.md new file mode 100644 index 00000000..f51da102 --- /dev/null +++ b/docs/PageGroupProjection.md @@ -0,0 +1,21 @@ +# PageGroupProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [GroupProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageInboxForwarderDto.md b/docs/PageInboxForwarderDto.md new file mode 100644 index 00000000..d8721e48 --- /dev/null +++ b/docs/PageInboxForwarderDto.md @@ -0,0 +1,21 @@ +# PageInboxForwarderDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [InboxForwarderDto] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageInboxProjection.md b/docs/PageInboxProjection.md new file mode 100644 index 00000000..d3dc0b68 --- /dev/null +++ b/docs/PageInboxProjection.md @@ -0,0 +1,21 @@ +# PageInboxProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [InboxPreview] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageInboxRulesetDto.md b/docs/PageInboxRulesetDto.md new file mode 100644 index 00000000..045bd190 --- /dev/null +++ b/docs/PageInboxRulesetDto.md @@ -0,0 +1,21 @@ +# PageInboxRulesetDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [InboxRulesetDto] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageMissedEmailProjection.md b/docs/PageMissedEmailProjection.md new file mode 100644 index 00000000..c7ccede5 --- /dev/null +++ b/docs/PageMissedEmailProjection.md @@ -0,0 +1,21 @@ +# PageMissedEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [MissedEmailProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageOrganizationInboxProjection.md b/docs/PageOrganizationInboxProjection.md new file mode 100644 index 00000000..b565318b --- /dev/null +++ b/docs/PageOrganizationInboxProjection.md @@ -0,0 +1,21 @@ +# PageOrganizationInboxProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [OrganizationInboxProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PagePhoneNumberProjection.md b/docs/PagePhoneNumberProjection.md new file mode 100644 index 00000000..ec9cd0db --- /dev/null +++ b/docs/PagePhoneNumberProjection.md @@ -0,0 +1,21 @@ +# PagePhoneNumberProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [PhoneNumberProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageSentEmailProjection.md b/docs/PageSentEmailProjection.md new file mode 100644 index 00000000..fe189438 --- /dev/null +++ b/docs/PageSentEmailProjection.md @@ -0,0 +1,21 @@ +# PageSentEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [SentEmailProjection] | Collection of items | +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**size** | **Int** | Size of page requested | +**number** | **Int** | Page number starting at 0 | +**numberOfElements** | **Int** | Number of items returned | +**totalElements** | **Int64** | Total number of items available for querying | +**totalPages** | **Int** | Total number of pages available | +**last** | **Bool** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageSentEmailWithQueueProjection.md b/docs/PageSentEmailWithQueueProjection.md new file mode 100644 index 00000000..2c296130 --- /dev/null +++ b/docs/PageSentEmailWithQueueProjection.md @@ -0,0 +1,21 @@ +# PageSentEmailWithQueueProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [SendWithQueueResult] | Collection of items | +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**size** | **Int** | Size of page requested | +**number** | **Int** | Page number starting at 0 | +**numberOfElements** | **Int** | Number of items returned | +**totalElements** | **Int64** | Total number of items available for querying | +**totalPages** | **Int** | Total number of pages available | +**last** | **Bool** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageSmsProjection.md b/docs/PageSmsProjection.md new file mode 100644 index 00000000..5cc1b98a --- /dev/null +++ b/docs/PageSmsProjection.md @@ -0,0 +1,21 @@ +# PageSmsProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [SmsProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageTemplateProjection.md b/docs/PageTemplateProjection.md new file mode 100644 index 00000000..0d897b02 --- /dev/null +++ b/docs/PageTemplateProjection.md @@ -0,0 +1,21 @@ +# PageTemplateProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [TemplateProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageThreadProjection.md b/docs/PageThreadProjection.md new file mode 100644 index 00000000..60152293 --- /dev/null +++ b/docs/PageThreadProjection.md @@ -0,0 +1,21 @@ +# PageThreadProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [ThreadProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageTrackingPixelProjection.md b/docs/PageTrackingPixelProjection.md new file mode 100644 index 00000000..819519cd --- /dev/null +++ b/docs/PageTrackingPixelProjection.md @@ -0,0 +1,21 @@ +# PageTrackingPixelProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [TrackingPixelProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageUnknownMissedEmailProjection.md b/docs/PageUnknownMissedEmailProjection.md new file mode 100644 index 00000000..703d988a --- /dev/null +++ b/docs/PageUnknownMissedEmailProjection.md @@ -0,0 +1,21 @@ +# PageUnknownMissedEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [UnknownMissedEmailProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageWebhookProjection.md b/docs/PageWebhookProjection.md new file mode 100644 index 00000000..0787812b --- /dev/null +++ b/docs/PageWebhookProjection.md @@ -0,0 +1,21 @@ +# PageWebhookProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [WebhookProjection] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageWebhookResult.md b/docs/PageWebhookResult.md new file mode 100644 index 00000000..3a9e24e3 --- /dev/null +++ b/docs/PageWebhookResult.md @@ -0,0 +1,21 @@ +# PageWebhookResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [WebhookResultDto] | | [optional] +**pageable** | [**PageableObject**](PageableObject) | | [optional] +**total** | **Int64** | | [optional] +**last** | **Bool** | | [optional] +**totalElements** | **Int64** | | [optional] +**totalPages** | **Int** | | [optional] +**size** | **Int** | | [optional] +**number** | **Int** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**first** | **Bool** | | [optional] +**numberOfElements** | **Int** | | [optional] +**empty** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PageableObject.md b/docs/PageableObject.md new file mode 100644 index 00000000..2c73ad28 --- /dev/null +++ b/docs/PageableObject.md @@ -0,0 +1,15 @@ +# PageableObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**offset** | **Int64** | | [optional] +**sort** | [**Sort**](Sort) | | [optional] +**pageNumber** | **Int** | | [optional] +**pageSize** | **Int** | | [optional] +**paged** | **Bool** | | [optional] +**unpaged** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PhoneControllerAPI.md b/docs/PhoneControllerAPI.md new file mode 100644 index 00000000..3ead1992 --- /dev/null +++ b/docs/PhoneControllerAPI.md @@ -0,0 +1,419 @@ +# PhoneControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createEmergencyAddress**](PhoneControllerAPI#createemergencyaddress) | **POST** /phone/emergency-addresses | +[**deleteEmergencyAddress**](PhoneControllerAPI#deleteemergencyaddress) | **DELETE** /phone/emergency-addresses/{addressId} | +[**deletePhoneNumber**](PhoneControllerAPI#deletephonenumber) | **DELETE** /phone/numbers/{phoneNumberId} | +[**getEmergencyAddress**](PhoneControllerAPI#getemergencyaddress) | **GET** /phone/emergency-addresses/{addressId} | +[**getEmergencyAddresses**](PhoneControllerAPI#getemergencyaddresses) | **GET** /phone/emergency-addresses | +[**getPhoneNumber**](PhoneControllerAPI#getphonenumber) | **GET** /phone/numbers/{phoneNumberId} | +[**getPhoneNumbers**](PhoneControllerAPI#getphonenumbers) | **GET** /phone/numbers | +[**getPhonePlans**](PhoneControllerAPI#getphoneplans) | **GET** /phone/plans | +[**testPhoneNumberSendSms**](PhoneControllerAPI#testphonenumbersendsms) | **POST** /phone/numbers/{phoneNumberId}/test | + + +# **createEmergencyAddress** +```swift + open class func createEmergencyAddress( createEmergencyAddressOptions: CreateEmergencyAddressOptions) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createEmergencyAddressOptions = CreateEmergencyAddressOptions(customerName: "customerName_example", address1: "address1_example", city: "city_example", region: "region_example", postalCode: "postalCode_example", isoCountryCode: "isoCountryCode_example", displayName: "displayName_example") // CreateEmergencyAddressOptions | + +PhoneControllerAPI.createEmergencyAddress(createEmergencyAddressOptions: createEmergencyAddressOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createEmergencyAddressOptions** | [**CreateEmergencyAddressOptions**](CreateEmergencyAddressOptions) | | + +### Return type + +[**EmergencyAddress**](EmergencyAddress) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteEmergencyAddress** +```swift + open class func deleteEmergencyAddress( addressId: UUID) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let addressId = 987 // UUID | + +PhoneControllerAPI.deleteEmergencyAddress(addressId: addressId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addressId** | [**UUID**]() | | + +### Return type + +[**EmptyResponseDto**](EmptyResponseDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deletePhoneNumber** +```swift + open class func deletePhoneNumber( phoneNumberId: UUID) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneNumberId = 987 // UUID | + +PhoneControllerAPI.deletePhoneNumber(phoneNumberId: phoneNumberId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneNumberId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmergencyAddress** +```swift + open class func getEmergencyAddress( addressId: UUID) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let addressId = 987 // UUID | + +PhoneControllerAPI.getEmergencyAddress(addressId: addressId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addressId** | [**UUID**]() | | + +### Return type + +[**EmergencyAddress**](EmergencyAddress) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getEmergencyAddresses** +```swift + open class func getEmergencyAddresses() -> Promise<[EmergencyAddressDto]> +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +PhoneControllerAPI.getEmergencyAddresses().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[EmergencyAddressDto]**](EmergencyAddressDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getPhoneNumber** +```swift + open class func getPhoneNumber( phoneNumberId: UUID) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneNumberId = 987 // UUID | + +PhoneControllerAPI.getPhoneNumber(phoneNumberId: phoneNumberId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneNumberId** | [**UUID**]() | | + +### Return type + +[**PhoneNumberDto**](PhoneNumberDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getPhoneNumbers** +```swift + open class func getPhoneNumbers( phoneCountry: PhoneCountry_getPhoneNumbers? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getPhoneNumbers? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneCountry = "phoneCountry_example" // String | Optional phone country (optional) +let page = 987 // Int | Optional page index for list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size for list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +PhoneControllerAPI.getPhoneNumbers(phoneCountry: phoneCountry, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneCountry** | **String** | Optional phone country | [optional] + **page** | **Int** | Optional page index for list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size for list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PagePhoneNumberProjection**](PagePhoneNumberProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getPhonePlans** +```swift + open class func getPhonePlans() -> Promise<[PhonePlanDto]> +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +PhoneControllerAPI.getPhonePlans().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[PhonePlanDto]**](PhonePlanDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **testPhoneNumberSendSms** +```swift + open class func testPhoneNumberSendSms( phoneNumberId: UUID, testPhoneNumberOptions: TestPhoneNumberOptions, xTestId: String? = nil) -> Promise +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneNumberId = 987 // UUID | +let testPhoneNumberOptions = TestPhoneNumberOptions(message: "message_example") // TestPhoneNumberOptions | +let xTestId = "xTestId_example" // String | (optional) + +PhoneControllerAPI.testPhoneNumberSendSms(phoneNumberId: phoneNumberId, testPhoneNumberOptions: testPhoneNumberOptions, xTestId: xTestId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneNumberId** | [**UUID**]() | | + **testPhoneNumberOptions** | [**TestPhoneNumberOptions**](TestPhoneNumberOptions) | | + **xTestId** | **String** | | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/PhoneNumberDto.md b/docs/PhoneNumberDto.md new file mode 100644 index 00000000..3d8785c1 --- /dev/null +++ b/docs/PhoneNumberDto.md @@ -0,0 +1,18 @@ +# PhoneNumberDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**complianceAddress** | **UUID** | | [optional] +**emergencyAddress** | **UUID** | | [optional] +**phoneNumber** | **String** | | +**phoneCountry** | **String** | | +**phonePlan** | **UUID** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PhoneNumberProjection.md b/docs/PhoneNumberProjection.md new file mode 100644 index 00000000..1f484943 --- /dev/null +++ b/docs/PhoneNumberProjection.md @@ -0,0 +1,14 @@ +# PhoneNumberProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**phoneNumber** | **String** | | +**phoneCountry** | **String** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/PhonePlanDto.md b/docs/PhonePlanDto.md new file mode 100644 index 00000000..ed29bb2b --- /dev/null +++ b/docs/PhonePlanDto.md @@ -0,0 +1,13 @@ +# PhonePlanDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**phoneCountry** | **String** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/RawEmailJson.md b/docs/RawEmailJson.md new file mode 100644 index 00000000..9414218b --- /dev/null +++ b/docs/RawEmailJson.md @@ -0,0 +1,10 @@ +# RawEmailJson + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/Recipient.md b/docs/Recipient.md new file mode 100644 index 00000000..660ece89 --- /dev/null +++ b/docs/Recipient.md @@ -0,0 +1,12 @@ +# Recipient + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rawValue** | **String** | | +**emailAddress** | **String** | | +**name** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ReplyToAliasEmailOptions.md b/docs/ReplyToAliasEmailOptions.md new file mode 100644 index 00000000..6e72cb90 --- /dev/null +++ b/docs/ReplyToAliasEmailOptions.md @@ -0,0 +1,18 @@ +# ReplyToAliasEmailOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | Body of the reply email you want to send | +**isHTML** | **Bool** | Is the reply HTML | +**charset** | **String** | The charset that your message should be sent with. Optional. Default is UTF-8 | [optional] +**attachments** | **[String]** | List of uploaded attachments to send with the reply. Optional. | [optional] +**templateVariables** | [String: AnyCodable] | Template variables if using a template | [optional] +**template** | **UUID** | Template ID to use instead of body. Will use template variable map to fill defined variable slots. | [optional] +**sendStrategy** | **String** | How an email should be sent based on its recipients | [optional] +**useInboxName** | **Bool** | Optionally use inbox name as display name for sender email address | [optional] +**html** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ReplyToEmailOptions.md b/docs/ReplyToEmailOptions.md new file mode 100644 index 00000000..1288e6e4 --- /dev/null +++ b/docs/ReplyToEmailOptions.md @@ -0,0 +1,20 @@ +# ReplyToEmailOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | Body of the reply email you want to send | +**isHTML** | **Bool** | Is the reply HTML | +**from** | **String** | The from header that should be used. Optional | [optional] +**replyTo** | **String** | The replyTo header that should be used. Optional | [optional] +**charset** | **String** | The charset that your message should be sent with. Optional. Default is UTF-8 | [optional] +**attachments** | **[String]** | List of uploaded attachments to send with the reply. Optional. | [optional] +**templateVariables** | [String: AnyCodable] | Template variables if using a template | [optional] +**template** | **UUID** | Template ID to use instead of body. Will use template variable map to fill defined variable slots. | [optional] +**sendStrategy** | **String** | How an email should be sent based on its recipients | [optional] +**useInboxName** | **Bool** | Optionally use inbox name as display name for sender email address | [optional] +**html** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SendEmailOptions.md b/docs/SendEmailOptions.md new file mode 100644 index 00000000..399e66ae --- /dev/null +++ b/docs/SendEmailOptions.md @@ -0,0 +1,29 @@ +# SendEmailOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toContacts** | **[UUID]** | Optional list of contact IDs to send email to. Manage your contacts via the API or dashboard. When contacts are used the email is sent to each contact separately so they will not see other recipients. | [optional] +**toGroup** | **UUID** | Optional contact group ID to send email to. You can create contacts and contact groups in the API or dashboard and use them for email campaigns. When contact groups are used the email is sent to each contact separately so they will not see other recipients | [optional] +**to** | **[String]** | List of destination email addresses. Each email address must be RFC 5322 format. Even single recipients must be in array form. Maximum recipients per email depends on your plan. If you need to send many emails try using contacts or contact groups or use a non standard sendStrategy to ensure that spam filters are not triggered (many recipients in one email can affect your spam rating). Be cautious when sending emails that your recipients exist. High bounce rates (meaning a high percentage of emails cannot be delivered because an address does not exist) can result in account freezing. | [optional] +**from** | **String** | Optional from address. Email address is RFC 5322 format and may include a display name and email in angle brackets (`my@address.com` or `My inbox <my@address.com>`). If no sender is set the source inbox address will be used for this field. If you set `useInboxName` to `true` the from field will include the inbox name as a display name: `inbox_name <inbox@address.com>`. For this to work use the name field when creating an inbox. Beware of potential spam penalties when setting the from field to an address not used by the inbox. Your emails may get blocked by services if you impersonate another address. To use a custom email addresses use a custom domain. You can create domains with the DomainController. The domain must be verified in the dashboard before it can be used. | [optional] +**cc** | **[String]** | Optional list of cc destination email addresses | [optional] +**bcc** | **[String]** | Optional list of bcc destination email addresses | [optional] +**subject** | **String** | Optional email subject line | [optional] +**replyTo** | **String** | Optional replyTo header | [optional] +**body** | **String** | Optional contents of email. If body contains HTML then set `isHTML` to true to ensure that email clients render it correctly. You can use moustache template syntax in the email body in conjunction with `toGroup` contact variables or `templateVariables` data. If you need more templating control consider creating a template and using the `template` property instead of the body. | [optional] +**html** | **Bool** | Optional HTML flag to indicate that contents is HTML. Set's a `content-type: text/html` for email. (Deprecated: use `isHTML` instead.) | [optional] +**isHTML** | **Bool** | Optional HTML flag. If true the `content-type` of the email will be `text/html`. Set to true when sending HTML to ensure proper rending on email clients | [optional] +**charset** | **String** | Optional charset | [optional] +**attachments** | **[String]** | Optional list of attachment IDs to send with this email. You must first upload each attachment separately via method call or dashboard in order to obtain attachment IDs. This way you can reuse attachments with different emails once uploaded. There are several ways to upload that support `multi-part form`, `base64 file encoding`, and octet stream binary uploads. See the `UploadController` for available methods. | [optional] +**templateVariables** | [String: AnyCodable] | Optional map of template variables. Will replace moustache syntax variables in subject and body or template with the associated values if found. | [optional] +**template** | **UUID** | Optional template ID to use for body. Will override body if provided. When using a template make sure you pass the corresponding map of `templateVariables`. You can find which variables are needed by fetching the template itself or viewing it in the dashboard. | [optional] +**sendStrategy** | **String** | How an email should be sent based on its recipients | [optional] +**useInboxName** | **Bool** | Use name of inbox as sender email address name. Will construct RFC 5322 email address with `Inbox name <inbox@address.com>` if the inbox has a name. | [optional] +**addTrackingPixel** | **Bool** | Add tracking pixel to email | [optional] +**filterBouncedRecipients** | **Bool** | Filter recipients to remove any bounced recipients from to, bcc, and cc before sending | [optional] +**validateEmailAddresses** | **String** | Validate recipient email addresses before sending | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SendSMTPEnvelopeOptions.md b/docs/SendSMTPEnvelopeOptions.md new file mode 100644 index 00000000..1fb9eab9 --- /dev/null +++ b/docs/SendSMTPEnvelopeOptions.md @@ -0,0 +1,12 @@ +# SendSMTPEnvelopeOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rcptTo** | **[String]** | | +**mailFrom** | **String** | | +**data** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SendWithQueueResult.md b/docs/SendWithQueueResult.md new file mode 100644 index 00000000..33fd2e57 --- /dev/null +++ b/docs/SendWithQueueResult.md @@ -0,0 +1,19 @@ +# SendWithQueueResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**subject** | **String** | | [optional] +**inboxId** | **UUID** | | [optional] +**headerId** | **String** | | +**delivered** | **Bool** | | +**exceptionName** | **String** | | [optional] +**message** | **String** | | [optional] +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/Sender.md b/docs/Sender.md new file mode 100644 index 00000000..fcdb46c6 --- /dev/null +++ b/docs/Sender.md @@ -0,0 +1,12 @@ +# Sender + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rawValue** | **String** | | +**emailAddress** | **String** | | +**name** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SentEmailDto.md b/docs/SentEmailDto.md new file mode 100644 index 00000000..30375f9e --- /dev/null +++ b/docs/SentEmailDto.md @@ -0,0 +1,34 @@ +# SentEmailDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of sent email | +**userId** | **UUID** | User ID | +**inboxId** | **UUID** | Inbox ID email was sent from | +**domainId** | **UUID** | Domain ID | [optional] +**to** | **[String]** | Recipients email was sent to | [optional] +**from** | **String** | | [optional] +**replyTo** | **String** | | [optional] +**cc** | **[String]** | | [optional] +**bcc** | **[String]** | | [optional] +**attachments** | **[String]** | Array of IDs of attachments that were sent with this email | [optional] +**subject** | **String** | | [optional] +**bodyMD5Hash** | **String** | MD5 Hash | [optional] +**body** | **String** | | [optional] +**toContacts** | **[UUID]** | | [optional] +**toGroup** | **UUID** | | [optional] +**charset** | **String** | | [optional] +**isHTML** | **Bool** | | [optional] +**sentAt** | **Date** | | +**pixelIds** | **[UUID]** | | [optional] +**messageId** | **String** | | [optional] +**messageIds** | **[String]** | | [optional] +**virtualSend** | **Bool** | | [optional] +**templateId** | **UUID** | | [optional] +**templateVariables** | [String: AnyCodable] | | [optional] +**html** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SentEmailProjection.md b/docs/SentEmailProjection.md new file mode 100644 index 00000000..56dda8b9 --- /dev/null +++ b/docs/SentEmailProjection.md @@ -0,0 +1,21 @@ +# SentEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**from** | **String** | | [optional] +**userId** | **UUID** | | +**subject** | **String** | | [optional] +**attachments** | **[String]** | | +**inboxId** | **UUID** | | +**to** | **[String]** | | +**createdAt** | **Date** | | +**bcc** | **[String]** | | +**cc** | **[String]** | | +**bodyMD5Hash** | **String** | | [optional] +**virtualSend** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SentEmailsControllerAPI.md b/docs/SentEmailsControllerAPI.md new file mode 100644 index 00000000..ececd386 --- /dev/null +++ b/docs/SentEmailsControllerAPI.md @@ -0,0 +1,835 @@ +# SentEmailsControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteAllSentEmails**](SentEmailsControllerAPI#deleteallsentemails) | **DELETE** /sent | Delete all sent email receipts +[**deleteSentEmail**](SentEmailsControllerAPI#deletesentemail) | **DELETE** /sent/{id} | Delete sent email receipt +[**getAllSentTrackingPixels**](SentEmailsControllerAPI#getallsenttrackingpixels) | **GET** /sent/tracking-pixels | +[**getRawSentEmailContents**](SentEmailsControllerAPI#getrawsentemailcontents) | **GET** /sent/{emailId}/raw | Get raw sent email string. Returns unparsed raw SMTP message with headers and body. +[**getRawSentEmailJson**](SentEmailsControllerAPI#getrawsentemailjson) | **GET** /sent/{emailId}/raw/json | Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format. +[**getSentDeliveryStatus**](SentEmailsControllerAPI#getsentdeliverystatus) | **GET** /sent/delivery-status/{deliveryId} | +[**getSentDeliveryStatuses**](SentEmailsControllerAPI#getsentdeliverystatuses) | **GET** /sent/delivery-status | +[**getSentDeliveryStatusesBySentId**](SentEmailsControllerAPI#getsentdeliverystatusesbysentid) | **GET** /sent/{sentId}/delivery-status | +[**getSentEmail**](SentEmailsControllerAPI#getsentemail) | **GET** /sent/{id} | Get sent email receipt +[**getSentEmailHTMLContent**](SentEmailsControllerAPI#getsentemailhtmlcontent) | **GET** /sent/{id}/html | Get sent email HTML content +[**getSentEmailPreviewURLs**](SentEmailsControllerAPI#getsentemailpreviewurls) | **GET** /sent/{id}/urls | Get sent email URL for viewing in browser or downloading +[**getSentEmailTrackingPixels**](SentEmailsControllerAPI#getsentemailtrackingpixels) | **GET** /sent/{id}/tracking-pixels | +[**getSentEmails**](SentEmailsControllerAPI#getsentemails) | **GET** /sent | Get all sent emails in paginated form +[**getSentEmailsWithQueueResults**](SentEmailsControllerAPI#getsentemailswithqueueresults) | **GET** /sent/queue-results | Get results of email sent with queues in paginated form +[**getSentOrganizationEmails**](SentEmailsControllerAPI#getsentorganizationemails) | **GET** /sent/organization | +[**waitForDeliveryStatuses**](SentEmailsControllerAPI#waitfordeliverystatuses) | **GET** /sent/delivery-status/wait-for | + + +# **deleteAllSentEmails** +```swift + open class func deleteAllSentEmails() -> Promise +``` + +Delete all sent email receipts + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Delete all sent email receipts +SentEmailsControllerAPI.deleteAllSentEmails().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteSentEmail** +```swift + open class func deleteSentEmail( _id: UUID) -> Promise +``` + +Delete sent email receipt + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Delete sent email receipt +SentEmailsControllerAPI.deleteSentEmail(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllSentTrackingPixels** +```swift + open class func getAllSentTrackingPixels( page: Int? = nil, size: Int? = nil, sort: Sort_getAllSentTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get all sent email tracking pixels in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in sent email tracking pixel list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in sent email tracking pixel list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +SentEmailsControllerAPI.getAllSentTrackingPixels(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in sent email tracking pixel list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in sent email tracking pixel list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageTrackingPixelProjection**](PageTrackingPixelProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getRawSentEmailContents** +```swift + open class func getRawSentEmailContents( emailId: UUID) -> Promise +``` + +Get raw sent email string. Returns unparsed raw SMTP message with headers and body. + +Returns a raw, unparsed, and unprocessed sent email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawSentEmailJson endpoint + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get raw sent email string. Returns unparsed raw SMTP message with headers and body. +SentEmailsControllerAPI.getRawSentEmailContents(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getRawSentEmailJson** +```swift + open class func getRawSentEmailJson( emailId: UUID) -> Promise +``` + +Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format. + +Returns a raw, unparsed, and unprocessed sent email wrapped in a JSON response object for easier handling when compared with the getRawSentEmail text/plain response + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let emailId = 987 // UUID | ID of email + +// Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format. +SentEmailsControllerAPI.getRawSentEmailJson(emailId: emailId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **emailId** | [**UUID**]() | ID of email | + +### Return type + +[**RawEmailJson**](RawEmailJson) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentDeliveryStatus** +```swift + open class func getSentDeliveryStatus( deliveryId: UUID) -> Promise +``` + + + +Get a sent email delivery status + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let deliveryId = 987 // UUID | + +SentEmailsControllerAPI.getSentDeliveryStatus(deliveryId: deliveryId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deliveryId** | [**UUID**]() | | + +### Return type + +[**DeliveryStatusDto**](DeliveryStatusDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentDeliveryStatuses** +```swift + open class func getSentDeliveryStatuses( page: Int? = nil, size: Int? = nil, sort: Sort_getSentDeliveryStatuses? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get all sent email delivery statuses + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in delivery status list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in delivery status list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +SentEmailsControllerAPI.getSentDeliveryStatuses(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in delivery status list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in delivery status list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageDeliveryStatus**](PageDeliveryStatus) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentDeliveryStatusesBySentId** +```swift + open class func getSentDeliveryStatusesBySentId( sentId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getSentDeliveryStatusesBySentId? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get all sent email delivery statuses + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let sentId = 987 // UUID | +let page = 987 // Int | Optional page index in delivery status list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in delivery status list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +SentEmailsControllerAPI.getSentDeliveryStatusesBySentId(sentId: sentId, page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sentId** | [**UUID**]() | | + **page** | **Int** | Optional page index in delivery status list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in delivery status list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageDeliveryStatus**](PageDeliveryStatus) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentEmail** +```swift + open class func getSentEmail( _id: UUID) -> Promise +``` + +Get sent email receipt + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Get sent email receipt +SentEmailsControllerAPI.getSentEmail(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +[**SentEmailDto**](SentEmailDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentEmailHTMLContent** +```swift + open class func getSentEmailHTMLContent( _id: UUID) -> Promise +``` + +Get sent email HTML content + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Get sent email HTML content +SentEmailsControllerAPI.getSentEmailHTMLContent(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/html + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentEmailPreviewURLs** +```swift + open class func getSentEmailPreviewURLs( _id: UUID) -> Promise +``` + +Get sent email URL for viewing in browser or downloading + +Get a list of URLs for sent email content as text/html or raw SMTP message for viewing the message in a browser. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Get sent email URL for viewing in browser or downloading +SentEmailsControllerAPI.getSentEmailPreviewURLs(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +[**EmailPreviewUrls**](EmailPreviewUrls) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentEmailTrackingPixels** +```swift + open class func getSentEmailTrackingPixels( _id: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmailTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get all tracking pixels for a sent email in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | +let page = 987 // Int | Optional page index in sent email tracking pixel list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in sent email tracking pixel list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +SentEmailsControllerAPI.getSentEmailTrackingPixels(_id: _id, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + **page** | **Int** | Optional page index in sent email tracking pixel list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in sent email tracking pixel list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageTrackingPixelProjection**](PageTrackingPixelProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentEmails** +```swift + open class func getSentEmails( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all sent emails in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Optional inboxId to filter sender of sent emails by (optional) +let page = 987 // Int | Optional page index in inbox sent email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox sent email list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get all sent emails in paginated form +SentEmailsControllerAPI.getSentEmails(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Optional inboxId to filter sender of sent emails by | [optional] + **page** | **Int** | Optional page index in inbox sent email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox sent email list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageSentEmailProjection**](PageSentEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentEmailsWithQueueResults** +```swift + open class func getSentEmailsWithQueueResults( page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmailsWithQueueResults? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get results of email sent with queues in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in inbox sent email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in inbox sent email list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get results of email sent with queues in paginated form +SentEmailsControllerAPI.getSentEmailsWithQueueResults(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in inbox sent email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in inbox sent email list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageSentEmailWithQueueProjection**](PageSentEmailWithQueueProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSentOrganizationEmails** +```swift + open class func getSentOrganizationEmails( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSentOrganizationEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Get all sent organization emails in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Optional inboxId to filter sender of sent emails by (optional) +let page = 987 // Int | Optional page index in sent email list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in sent email list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +SentEmailsControllerAPI.getSentOrganizationEmails(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Optional inboxId to filter sender of sent emails by | [optional] + **page** | **Int** | Optional page index in sent email list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in sent email list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageSentEmailProjection**](PageSentEmailProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForDeliveryStatuses** +```swift + open class func waitForDeliveryStatuses( sentId: UUID? = nil, inboxId: UUID? = nil, timeout: Int64? = nil, index: Int? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + + + +Wait for delivery statuses + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let sentId = 987 // UUID | Optional sent email ID filter (optional) +let inboxId = 987 // UUID | Optional inbox ID filter (optional) +let timeout = 987 // Int64 | Optional timeout milliseconds (optional) +let index = 987 // Int | Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +SentEmailsControllerAPI.waitForDeliveryStatuses(sentId: sentId, inboxId: inboxId, timeout: timeout, index: index, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sentId** | [**UUID**]() | Optional sent email ID filter | [optional] + **inboxId** | [**UUID**]() | Optional inbox ID filter | [optional] + **timeout** | **Int64** | Optional timeout milliseconds | [optional] + **index** | **Int** | Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**DeliveryStatusDto**](DeliveryStatusDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/SetInboxFavouritedOptions.md b/docs/SetInboxFavouritedOptions.md new file mode 100644 index 00000000..07ba5a31 --- /dev/null +++ b/docs/SetInboxFavouritedOptions.md @@ -0,0 +1,10 @@ +# SetInboxFavouritedOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | **Bool** | Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SimpleSendEmailOptions.md b/docs/SimpleSendEmailOptions.md new file mode 100644 index 00000000..1ba78677 --- /dev/null +++ b/docs/SimpleSendEmailOptions.md @@ -0,0 +1,13 @@ +# SimpleSendEmailOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**senderId** | **UUID** | ID of inbox to send from. If null an inbox will be created for sending | [optional] +**to** | **String** | Email address to send to | +**body** | **String** | Body of the email message. Supports HTML | [optional] +**subject** | **String** | Subject line of the email | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SmsControllerAPI.md b/docs/SmsControllerAPI.md new file mode 100644 index 00000000..2d5f0ddf --- /dev/null +++ b/docs/SmsControllerAPI.md @@ -0,0 +1,212 @@ +# SmsControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteSmsMessage**](SmsControllerAPI#deletesmsmessage) | **DELETE** /sms/{smsId} | Delete SMS message. +[**deleteSmsMessages**](SmsControllerAPI#deletesmsmessages) | **DELETE** /sms | Delete all SMS messages +[**getSmsMessage**](SmsControllerAPI#getsmsmessage) | **GET** /sms/{smsId} | Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. +[**getSmsMessagesPaginated**](SmsControllerAPI#getsmsmessagespaginated) | **GET** /sms | Get all SMS messages in all phone numbers in paginated form. . + + +# **deleteSmsMessage** +```swift + open class func deleteSmsMessage( smsId: UUID) -> Promise +``` + +Delete SMS message. + +Delete an SMS message + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let smsId = 987 // UUID | + +// Delete SMS message. +SmsControllerAPI.deleteSmsMessage(smsId: smsId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **smsId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteSmsMessages** +```swift + open class func deleteSmsMessages( phoneNumberId: UUID? = nil) -> Promise +``` + +Delete all SMS messages + +Delete all SMS messages or all messages for a given phone number + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneNumberId = 987 // UUID | (optional) + +// Delete all SMS messages +SmsControllerAPI.deleteSmsMessages(phoneNumberId: phoneNumberId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneNumberId** | [**UUID**]() | | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSmsMessage** +```swift + open class func getSmsMessage( smsId: UUID) -> Promise +``` + +Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. + +Returns a SMS summary object with content. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let smsId = 987 // UUID | + +// Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. +SmsControllerAPI.getSmsMessage(smsId: smsId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **smsId** | [**UUID**]() | | + +### Return type + +[**SmsDto**](SmsDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getSmsMessagesPaginated** +```swift + open class func getSmsMessagesPaginated( phoneNumber: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSmsMessagesPaginated? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get all SMS messages in all phone numbers in paginated form. . + +By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneNumber = 987 // UUID | Optional receiving phone number to filter SMS messages for (optional) +let page = 987 // Int | Optional page index in SMS list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let unreadOnly = true // Bool | Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional) (default to false) +let since = Date() // Date | Optional filter SMSs received after given date time (optional) +let before = Date() // Date | Optional filter SMSs received before given date time (optional) + +// Get all SMS messages in all phone numbers in paginated form. . +SmsControllerAPI.getSmsMessagesPaginated(phoneNumber: phoneNumber, page: page, size: size, sort: sort, unreadOnly: unreadOnly, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneNumber** | [**UUID**]() | Optional receiving phone number to filter SMS messages for | [optional] + **page** | **Int** | Optional page index in SMS list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **unreadOnly** | **Bool** | Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly | [optional] [default to false] + **since** | **Date** | Optional filter SMSs received after given date time | [optional] + **before** | **Date** | Optional filter SMSs received before given date time | [optional] + +### Return type + +[**PageSmsProjection**](PageSmsProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/SmsDto.md b/docs/SmsDto.md new file mode 100644 index 00000000..538a2d03 --- /dev/null +++ b/docs/SmsDto.md @@ -0,0 +1,17 @@ +# SmsDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**phoneNumber** | **UUID** | | +**fromNumber** | **String** | | +**body** | **String** | | +**read** | **Bool** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SmsMatchOption.md b/docs/SmsMatchOption.md new file mode 100644 index 00000000..9b704d0a --- /dev/null +++ b/docs/SmsMatchOption.md @@ -0,0 +1,12 @@ +# SmsMatchOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **String** | Fields of an SMS object that can be used to filter results | +**should** | **String** | How the value of the email field specified should be compared to the value given in the match options. | +**value** | **String** | The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SmsPreview.md b/docs/SmsPreview.md new file mode 100644 index 00000000..bf8afbc9 --- /dev/null +++ b/docs/SmsPreview.md @@ -0,0 +1,15 @@ +# SmsPreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**userId** | **UUID** | | +**body** | **String** | | +**phoneNumber** | **UUID** | | +**fromNumber** | **String** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/SmsProjection.md b/docs/SmsProjection.md new file mode 100644 index 00000000..c9b36a24 --- /dev/null +++ b/docs/SmsProjection.md @@ -0,0 +1,16 @@ +# SmsProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**body** | **String** | | +**userId** | **UUID** | | +**phoneNumber** | **UUID** | | +**createdAt** | **Date** | | +**fromNumber** | **String** | | +**read** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/Sort.md b/docs/Sort.md new file mode 100644 index 00000000..5459c03d --- /dev/null +++ b/docs/Sort.md @@ -0,0 +1,12 @@ +# Sort + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**empty** | **Bool** | | [optional] +**sorted** | **Bool** | | [optional] +**unsorted** | **Bool** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TemplateControllerAPI.md b/docs/TemplateControllerAPI.md new file mode 100644 index 00000000..b09abf68 --- /dev/null +++ b/docs/TemplateControllerAPI.md @@ -0,0 +1,398 @@ +# TemplateControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTemplate**](TemplateControllerAPI#createtemplate) | **POST** /templates | Create a Template +[**deleteTemplate**](TemplateControllerAPI#deletetemplate) | **DELETE** /templates/{templateId} | Delete email template +[**getAllTemplates**](TemplateControllerAPI#getalltemplates) | **GET** /templates/paginated | List templates +[**getTemplate**](TemplateControllerAPI#gettemplate) | **GET** /templates/{templateId} | Get template +[**getTemplatePreviewHtml**](TemplateControllerAPI#gettemplatepreviewhtml) | **GET** /templates/{templateId}/preview/html | Get template preview HTML +[**getTemplatePreviewJson**](TemplateControllerAPI#gettemplatepreviewjson) | **GET** /templates/{templateId}/preview/json | Get template preview Json +[**getTemplates**](TemplateControllerAPI#gettemplates) | **GET** /templates | List templates +[**updateTemplate**](TemplateControllerAPI#updatetemplate) | **PUT** /templates/{templateId} | Update template + + +# **createTemplate** +```swift + open class func createTemplate( createTemplateOptions: CreateTemplateOptions) -> Promise +``` + +Create a Template + +Create an email template with variables for use with templated transactional emails. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createTemplateOptions = CreateTemplateOptions(name: "name_example", content: "content_example") // CreateTemplateOptions | + +// Create a Template +TemplateControllerAPI.createTemplate(createTemplateOptions: createTemplateOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createTemplateOptions** | [**CreateTemplateOptions**](CreateTemplateOptions) | | + +### Return type + +[**TemplateDto**](TemplateDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteTemplate** +```swift + open class func deleteTemplate( templateId: UUID) -> Promise +``` + +Delete email template + +Delete template + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let templateId = 987 // UUID | Template ID + +// Delete email template +TemplateControllerAPI.deleteTemplate(templateId: templateId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateId** | [**UUID**]() | Template ID | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllTemplates** +```swift + open class func getAllTemplates( page: Int? = nil, size: Int? = nil, sort: Sort_getAllTemplates? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List templates + +Get all templates in paginated format + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// List templates +TemplateControllerAPI.getAllTemplates(page: page, size: size, sort: sort, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageTemplateProjection**](PageTemplateProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTemplate** +```swift + open class func getTemplate( templateId: UUID) -> Promise +``` + +Get template + +Get email template + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let templateId = 987 // UUID | Template ID + +// Get template +TemplateControllerAPI.getTemplate(templateId: templateId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateId** | [**UUID**]() | Template ID | + +### Return type + +[**TemplateDto**](TemplateDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTemplatePreviewHtml** +```swift + open class func getTemplatePreviewHtml( templateId: UUID) -> Promise +``` + +Get template preview HTML + +Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let templateId = 987 // UUID | Template ID + +// Get template preview HTML +TemplateControllerAPI.getTemplatePreviewHtml(templateId: templateId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateId** | [**UUID**]() | Template ID | + +### Return type + +**String** + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/html;charset=utf-8, text/html + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTemplatePreviewJson** +```swift + open class func getTemplatePreviewJson( templateId: UUID) -> Promise +``` + +Get template preview Json + +Get email template preview with passed template variables in JSON format. Pass template variables as query params. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let templateId = 987 // UUID | Template ID + +// Get template preview Json +TemplateControllerAPI.getTemplatePreviewJson(templateId: templateId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateId** | [**UUID**]() | Template ID | + +### Return type + +[**TemplatePreview**](TemplatePreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTemplates** +```swift + open class func getTemplates() -> Promise<[TemplateProjection]> +``` + +List templates + +Get all templates + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// List templates +TemplateControllerAPI.getTemplates().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[TemplateProjection]**](TemplateProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **updateTemplate** +```swift + open class func updateTemplate( templateId: UUID, createTemplateOptions: CreateTemplateOptions) -> Promise +``` + +Update template + +Update email template + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let templateId = 987 // UUID | Template ID +let createTemplateOptions = CreateTemplateOptions(name: "name_example", content: "content_example") // CreateTemplateOptions | + +// Update template +TemplateControllerAPI.updateTemplate(templateId: templateId, createTemplateOptions: createTemplateOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateId** | [**UUID**]() | Template ID | + **createTemplateOptions** | [**CreateTemplateOptions**](CreateTemplateOptions) | | + +### Return type + +[**TemplateDto**](TemplateDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/TemplateDto.md b/docs/TemplateDto.md new file mode 100644 index 00000000..9aeb2e07 --- /dev/null +++ b/docs/TemplateDto.md @@ -0,0 +1,14 @@ +# TemplateDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of template | +**name** | **String** | Template name | +**variables** | [TemplateVariable] | Variables available in template that can be replaced with values | +**content** | **String** | Content of the template | +**createdAt** | **Date** | Created at time | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TemplatePreview.md b/docs/TemplatePreview.md new file mode 100644 index 00000000..8569cd64 --- /dev/null +++ b/docs/TemplatePreview.md @@ -0,0 +1,10 @@ +# TemplatePreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**preview** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TemplateProjection.md b/docs/TemplateProjection.md new file mode 100644 index 00000000..b8bdb0eb --- /dev/null +++ b/docs/TemplateProjection.md @@ -0,0 +1,14 @@ +# TemplateProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**_id** | **UUID** | | +**createdAt** | **Date** | | +**updatedAt** | **Date** | | +**variables** | **[String]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TemplateVariable.md b/docs/TemplateVariable.md new file mode 100644 index 00000000..fd9251f3 --- /dev/null +++ b/docs/TemplateVariable.md @@ -0,0 +1,11 @@ +# TemplateVariable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of variable. This can be used in a template as {{name}} | +**variableType** | **String** | The type of variable | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TestNewInboxForwarderOptions.md b/docs/TestNewInboxForwarderOptions.md new file mode 100644 index 00000000..991be50e --- /dev/null +++ b/docs/TestNewInboxForwarderOptions.md @@ -0,0 +1,11 @@ +# TestNewInboxForwarderOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxForwarderTestOptions** | [**InboxForwarderTestOptions**](InboxForwarderTestOptions) | | +**createInboxForwarderOptions** | [**CreateInboxForwarderOptions**](CreateInboxForwarderOptions) | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TestNewInboxRulesetOptions.md b/docs/TestNewInboxRulesetOptions.md new file mode 100644 index 00000000..df9c90e7 --- /dev/null +++ b/docs/TestNewInboxRulesetOptions.md @@ -0,0 +1,11 @@ +# TestNewInboxRulesetOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxRulesetTestOptions** | [**InboxRulesetTestOptions**](InboxRulesetTestOptions) | | +**createInboxRulesetOptions** | [**CreateInboxRulesetOptions**](CreateInboxRulesetOptions) | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TestPhoneNumberOptions.md b/docs/TestPhoneNumberOptions.md new file mode 100644 index 00000000..3c09a799 --- /dev/null +++ b/docs/TestPhoneNumberOptions.md @@ -0,0 +1,10 @@ +# TestPhoneNumberOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ThreadProjection.md b/docs/ThreadProjection.md new file mode 100644 index 00000000..78f304a2 --- /dev/null +++ b/docs/ThreadProjection.md @@ -0,0 +1,20 @@ +# ThreadProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of thread | [optional] +**_id** | **UUID** | ID of email thread | +**subject** | **String** | Thread subject | [optional] +**inboxId** | **UUID** | Inbox ID | +**userId** | **UUID** | User ID | +**to** | **[String]** | To recipients | +**createdAt** | **Date** | Created at DateTime | +**updatedAt** | **Date** | Updated at DateTime | +**bcc** | **[String]** | BCC recipients | [optional] +**cc** | **[String]** | CC recipients | [optional] +**aliasId** | **UUID** | Alias ID | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TrackingControllerAPI.md b/docs/TrackingControllerAPI.md new file mode 100644 index 00000000..ec4b0fed --- /dev/null +++ b/docs/TrackingControllerAPI.md @@ -0,0 +1,160 @@ +# TrackingControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTrackingPixel**](TrackingControllerAPI#createtrackingpixel) | **POST** /tracking/pixels | Create tracking pixel +[**getAllTrackingPixels**](TrackingControllerAPI#getalltrackingpixels) | **GET** /tracking/pixels | Get tracking pixels +[**getTrackingPixel**](TrackingControllerAPI#gettrackingpixel) | **GET** /tracking/pixels/{id} | Get pixel + + +# **createTrackingPixel** +```swift + open class func createTrackingPixel( createTrackingPixelOptions: CreateTrackingPixelOptions) -> Promise +``` + +Create tracking pixel + +Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createTrackingPixelOptions = CreateTrackingPixelOptions(name: "name_example", recipient: "recipient_example") // CreateTrackingPixelOptions | + +// Create tracking pixel +TrackingControllerAPI.createTrackingPixel(createTrackingPixelOptions: createTrackingPixelOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createTrackingPixelOptions** | [**CreateTrackingPixelOptions**](CreateTrackingPixelOptions) | | + +### Return type + +[**TrackingPixelDto**](TrackingPixelDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllTrackingPixels** +```swift + open class func getAllTrackingPixels( page: Int? = nil, size: Int? = nil, sort: Sort_getAllTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get tracking pixels + +List tracking pixels in paginated form + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get tracking pixels +TrackingControllerAPI.getAllTrackingPixels(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageTrackingPixelProjection**](PageTrackingPixelProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTrackingPixel** +```swift + open class func getTrackingPixel( _id: UUID) -> Promise +``` + +Get pixel + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let _id = 987 // UUID | + +// Get pixel +TrackingControllerAPI.getTrackingPixel(_id: _id).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | [**UUID**]() | | + +### Return type + +[**TrackingPixelDto**](TrackingPixelDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/TrackingPixelDto.md b/docs/TrackingPixelDto.md new file mode 100644 index 00000000..6a1f1b9d --- /dev/null +++ b/docs/TrackingPixelDto.md @@ -0,0 +1,18 @@ +# TrackingPixelDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**seen** | **Bool** | | +**recipient** | **String** | | [optional] +**html** | **String** | | +**url** | **String** | | +**inboxId** | **UUID** | | [optional] +**sentEmailId** | **UUID** | | [optional] +**seenAt** | **Date** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/TrackingPixelProjection.md b/docs/TrackingPixelProjection.md new file mode 100644 index 00000000..07ddb356 --- /dev/null +++ b/docs/TrackingPixelProjection.md @@ -0,0 +1,18 @@ +# TrackingPixelProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**_id** | **UUID** | | +**inboxId** | **UUID** | | [optional] +**userId** | **UUID** | | +**sentEmailId** | **UUID** | | [optional] +**createdAt** | **Date** | | +**recipient** | **String** | | [optional] +**seen** | **Bool** | | +**seenAt** | **Date** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UnknownMissedEmailProjection.md b/docs/UnknownMissedEmailProjection.md new file mode 100644 index 00000000..51661a3b --- /dev/null +++ b/docs/UnknownMissedEmailProjection.md @@ -0,0 +1,14 @@ +# UnknownMissedEmailProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**from** | **String** | | [optional] +**subject** | **String** | | [optional] +**to** | **[String]** | | [optional] +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UnreadCount.md b/docs/UnreadCount.md new file mode 100644 index 00000000..5bbe3802 --- /dev/null +++ b/docs/UnreadCount.md @@ -0,0 +1,10 @@ +# UnreadCount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **Int64** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UnseenErrorCountDto.md b/docs/UnseenErrorCountDto.md new file mode 100644 index 00000000..d00b207a --- /dev/null +++ b/docs/UnseenErrorCountDto.md @@ -0,0 +1,10 @@ +# UnseenErrorCountDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **Int64** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UpdateAliasOptions.md b/docs/UpdateAliasOptions.md new file mode 100644 index 00000000..df409c05 --- /dev/null +++ b/docs/UpdateAliasOptions.md @@ -0,0 +1,10 @@ +# UpdateAliasOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Optional name for alias | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UpdateDomainOptions.md b/docs/UpdateDomainOptions.md new file mode 100644 index 00000000..8101f7f3 --- /dev/null +++ b/docs/UpdateDomainOptions.md @@ -0,0 +1,10 @@ +# UpdateDomainOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**catchAllInboxId** | **UUID** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UpdateGroupContacts.md b/docs/UpdateGroupContacts.md new file mode 100644 index 00000000..a95b0148 --- /dev/null +++ b/docs/UpdateGroupContacts.md @@ -0,0 +1,10 @@ +# UpdateGroupContacts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contactIds** | **[UUID]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UpdateInboxOptions.md b/docs/UpdateInboxOptions.md new file mode 100644 index 00000000..b2cfe826 --- /dev/null +++ b/docs/UpdateInboxOptions.md @@ -0,0 +1,14 @@ +# UpdateInboxOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search | [optional] +**_description** | **String** | Description of an inbox for labelling and searching purposes | [optional] +**tags** | **[String]** | Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. | [optional] +**expiresAt** | **Date** | Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email. | [optional] +**favourite** | **Bool** | Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UploadAttachmentOptions.md b/docs/UploadAttachmentOptions.md new file mode 100644 index 00000000..33354fc8 --- /dev/null +++ b/docs/UploadAttachmentOptions.md @@ -0,0 +1,12 @@ +# UploadAttachmentOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contentType** | **String** | Optional contentType for file. For instance `application/pdf` | [optional] +**filename** | **String** | Optional filename to save upload with. Will be the name that is shown in email clients | [optional] +**base64Contents** | **String** | Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/ | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/UserInfoDto.md b/docs/UserInfoDto.md new file mode 100644 index 00000000..1e613d27 --- /dev/null +++ b/docs/UserInfoDto.md @@ -0,0 +1,15 @@ +# UserInfoDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | +**emailAddress** | **String** | | +**accountState** | **String** | | +**subscriptionType** | **String** | | [optional] +**accountType** | **String** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ValidateEmailAddressListOptions.md b/docs/ValidateEmailAddressListOptions.md new file mode 100644 index 00000000..3005ec45 --- /dev/null +++ b/docs/ValidateEmailAddressListOptions.md @@ -0,0 +1,10 @@ +# ValidateEmailAddressListOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emailAddressList** | **[String]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ValidateEmailAddressListResult.md b/docs/ValidateEmailAddressListResult.md new file mode 100644 index 00000000..b98bd73f --- /dev/null +++ b/docs/ValidateEmailAddressListResult.md @@ -0,0 +1,12 @@ +# ValidateEmailAddressListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**validEmailAddresses** | **[String]** | | +**invalidEmailAddresses** | **[String]** | | +**resultMapEmailAddressIsValid** | **[String: Bool]** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ValidationDto.md b/docs/ValidationDto.md new file mode 100644 index 00000000..cba97fd5 --- /dev/null +++ b/docs/ValidationDto.md @@ -0,0 +1,11 @@ +# ValidationDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emailId** | **UUID** | ID of the email validated | +**html** | [**HTMLValidationResult**](HTMLValidationResult) | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/ValidationMessage.md b/docs/ValidationMessage.md new file mode 100644 index 00000000..b17c808f --- /dev/null +++ b/docs/ValidationMessage.md @@ -0,0 +1,11 @@ +# ValidationMessage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lineNumber** | **Int** | | +**message** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/VerifyEmailAddressOptions.md b/docs/VerifyEmailAddressOptions.md new file mode 100644 index 00000000..89735e84 --- /dev/null +++ b/docs/VerifyEmailAddressOptions.md @@ -0,0 +1,13 @@ +# VerifyEmailAddressOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mailServerDomain** | **String** | | [optional] +**emailAddress** | **String** | | +**senderEmailAddress** | **String** | | [optional] +**port** | **Int** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/VerifyWebhookSignatureOptions.md b/docs/VerifyWebhookSignatureOptions.md new file mode 100644 index 00000000..57451f99 --- /dev/null +++ b/docs/VerifyWebhookSignatureOptions.md @@ -0,0 +1,11 @@ +# VerifyWebhookSignatureOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | | +**signature** | **String** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/VerifyWebhookSignatureResults.md b/docs/VerifyWebhookSignatureResults.md new file mode 100644 index 00000000..35ca764a --- /dev/null +++ b/docs/VerifyWebhookSignatureResults.md @@ -0,0 +1,10 @@ +# VerifyWebhookSignatureResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isValid** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WaitForConditions.md b/docs/WaitForConditions.md new file mode 100644 index 00000000..66f5502f --- /dev/null +++ b/docs/WaitForConditions.md @@ -0,0 +1,19 @@ +# WaitForConditions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inboxId** | **UUID** | ID of inbox to search within and apply conditions to. Essentially filtering the emails found to give a count. | +**count** | **Int** | Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation. | [optional] +**delayTimeout** | **Int64** | Max time in milliseconds to wait between retries if a `timeout` is specified. | [optional] +**timeout** | **Int64** | Max time in milliseconds to retry the `waitFor` operation until conditions are met. | +**unreadOnly** | **Bool** | Apply conditions only to **unread** emails. All emails begin with `read=false`. An email is marked `read=true` when an `EmailDto` representation of it has been returned to the user at least once. For example you have called `getEmail` or `waitForLatestEmail` etc., or you have viewed the email in the dashboard. | [optional] +**countType** | **String** | How result size should be compared with the expected size. Exactly or at-least matching result? | [optional] +**matches** | [MatchOption] | Conditions that should be matched for an email to qualify for results. Each condition will be applied in order to each email within an inbox to filter a result list of matching emails you are waiting for. | [optional] +**sortDirection** | **String** | Direction to sort matching emails by created time | [optional] +**since** | **Date** | ISO Date Time earliest time of email to consider. Filter for matching emails that were received after this date | [optional] +**before** | **Date** | ISO Date Time latest time of email to consider. Filter for matching emails that were received before this date | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WaitForControllerAPI.md b/docs/WaitForControllerAPI.md new file mode 100644 index 00000000..48072c89 --- /dev/null +++ b/docs/WaitForControllerAPI.md @@ -0,0 +1,462 @@ +# WaitForControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**waitFor**](WaitForControllerAPI#waitfor) | **POST** /waitFor | Wait for an email to match the provided filter conditions such as subject contains keyword. +[**waitForEmailCount**](WaitForControllerAPI#waitforemailcount) | **GET** /waitForEmailCount | Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs +[**waitForLatestEmail**](WaitForControllerAPI#waitforlatestemail) | **GET** /waitForLatestEmail | Fetch inbox's latest email or if empty wait for an email to arrive +[**waitForLatestSms**](WaitForControllerAPI#waitforlatestsms) | **POST** /waitForLatestSms | Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. +[**waitForMatchingEmails**](WaitForControllerAPI#waitformatchingemails) | **POST** /waitForMatchingEmails | Wait or return list of emails that match simple matching patterns +[**waitForMatchingFirstEmail**](WaitForControllerAPI#waitformatchingfirstemail) | **POST** /waitForMatchingFirstEmail | Wait for or return the first email that matches provided MatchOptions array +[**waitForNthEmail**](WaitForControllerAPI#waitfornthemail) | **GET** /waitForNthEmail | Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. +[**waitForSms**](WaitForControllerAPI#waitforsms) | **POST** /waitForSms | Wait for an SMS message to match the provided filter conditions such as body contains keyword. + + +# **waitFor** +```swift + open class func waitFor( waitForConditions: WaitForConditions) -> Promise<[EmailPreview]> +``` + +Wait for an email to match the provided filter conditions such as subject contains keyword. + +Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let waitForConditions = WaitForConditions(inboxId: 123, count: 123, delayTimeout: 123, timeout: 123, unreadOnly: false, countType: "countType_example", matches: [MatchOption(field: "field_example", should: "should_example", value: "value_example")], sortDirection: "sortDirection_example", since: Date(), before: Date()) // WaitForConditions | + +// Wait for an email to match the provided filter conditions such as subject contains keyword. +WaitForControllerAPI.waitFor(waitForConditions: waitForConditions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waitForConditions** | [**WaitForConditions**](WaitForConditions) | | + +### Return type + +[**[EmailPreview]**](EmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForEmailCount** +```swift + open class func waitForEmailCount( inboxId: UUID, count: Int, timeout: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sort: Sort_waitForEmailCount? = nil, delay: Int64? = nil) -> Promise<[EmailPreview]> +``` + +Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs + +If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of the inbox we are fetching emails from +let count = 987 // Int | Number of emails to wait for. Must be greater that 1 +let timeout = 987 // Int64 | Max milliseconds to wait (optional) +let unreadOnly = true // Bool | Optional filter for unread only (optional) (default to false) +let before = Date() // Date | Filter for emails that were received before the given timestamp (optional) +let since = Date() // Date | Filter for emails that were received after the given timestamp (optional) +let sort = "sort_example" // String | Sort direction (optional) +let delay = 987 // Int64 | Max milliseconds delay between calls (optional) + +// Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs +WaitForControllerAPI.waitForEmailCount(inboxId: inboxId, count: count, timeout: timeout, unreadOnly: unreadOnly, before: before, since: since, sort: sort, delay: delay).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of the inbox we are fetching emails from | + **count** | **Int** | Number of emails to wait for. Must be greater that 1 | + **timeout** | **Int64** | Max milliseconds to wait | [optional] + **unreadOnly** | **Bool** | Optional filter for unread only | [optional] [default to false] + **before** | **Date** | Filter for emails that were received before the given timestamp | [optional] + **since** | **Date** | Filter for emails that were received after the given timestamp | [optional] + **sort** | **String** | Sort direction | [optional] + **delay** | **Int64** | Max milliseconds delay between calls | [optional] + +### Return type + +[**[EmailPreview]**](EmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForLatestEmail** +```swift + open class func waitForLatestEmail( inboxId: UUID? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sort: Sort_waitForLatestEmail? = nil, delay: Int64? = nil) -> Promise +``` + +Fetch inbox's latest email or if empty wait for an email to arrive + +Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set `unreadOnly=true` or see the other receive methods such as `waitForNthEmail` or `waitForEmailCount`. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of the inbox we are fetching emails from (optional) +let timeout = 987 // Int64 | Max milliseconds to wait (optional) +let unreadOnly = true // Bool | Optional filter for unread only. (optional) (default to false) +let before = Date() // Date | Filter for emails that were before after the given timestamp (optional) +let since = Date() // Date | Filter for emails that were received after the given timestamp (optional) +let sort = "sort_example" // String | Sort direction (optional) +let delay = 987 // Int64 | Max milliseconds delay between calls (optional) + +// Fetch inbox's latest email or if empty wait for an email to arrive +WaitForControllerAPI.waitForLatestEmail(inboxId: inboxId, timeout: timeout, unreadOnly: unreadOnly, before: before, since: since, sort: sort, delay: delay).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of the inbox we are fetching emails from | [optional] + **timeout** | **Int64** | Max milliseconds to wait | [optional] + **unreadOnly** | **Bool** | Optional filter for unread only. | [optional] [default to false] + **before** | **Date** | Filter for emails that were before after the given timestamp | [optional] + **since** | **Date** | Filter for emails that were received after the given timestamp | [optional] + **sort** | **String** | Sort direction | [optional] + **delay** | **Int64** | Max milliseconds delay between calls | [optional] + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForLatestSms** +```swift + open class func waitForLatestSms( waitForSingleSmsOptions: WaitForSingleSmsOptions) -> Promise +``` + +Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. + +Wait until a phone number meets given conditions or return immediately if already met + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let waitForSingleSmsOptions = WaitForSingleSmsOptions(phoneNumberId: 123, timeout: 123, unreadOnly: false, before: Date(), since: Date(), sortDirection: "sortDirection_example", delay: 123) // WaitForSingleSmsOptions | + +// Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. +WaitForControllerAPI.waitForLatestSms(waitForSingleSmsOptions: waitForSingleSmsOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waitForSingleSmsOptions** | [**WaitForSingleSmsOptions**](WaitForSingleSmsOptions) | | + +### Return type + +[**SmsDto**](SmsDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForMatchingEmails** +```swift + open class func waitForMatchingEmails( inboxId: UUID, count: Int, matchOptions: MatchOptions, before: Date? = nil, since: Date? = nil, sort: Sort_waitForMatchingEmails? = nil, delay: Int64? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil) -> Promise<[EmailPreview]> +``` + +Wait or return list of emails that match simple matching patterns + +Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of the inbox we are fetching emails from +let count = 987 // Int | Number of emails to wait for. Must be greater or equal to 1 +let matchOptions = MatchOptions(matches: [MatchOption(field: "field_example", should: "should_example", value: "value_example")], conditions: [ConditionOption(condition: "condition_example", value: "value_example")]) // MatchOptions | +let before = Date() // Date | Filter for emails that were received before the given timestamp (optional) +let since = Date() // Date | Filter for emails that were received after the given timestamp (optional) +let sort = "sort_example" // String | Sort direction (optional) +let delay = 987 // Int64 | Max milliseconds delay between calls (optional) +let timeout = 987 // Int64 | Max milliseconds to wait (optional) +let unreadOnly = true // Bool | Optional filter for unread only (optional) (default to false) + +// Wait or return list of emails that match simple matching patterns +WaitForControllerAPI.waitForMatchingEmails(inboxId: inboxId, count: count, matchOptions: matchOptions, before: before, since: since, sort: sort, delay: delay, timeout: timeout, unreadOnly: unreadOnly).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of the inbox we are fetching emails from | + **count** | **Int** | Number of emails to wait for. Must be greater or equal to 1 | + **matchOptions** | [**MatchOptions**](MatchOptions) | | + **before** | **Date** | Filter for emails that were received before the given timestamp | [optional] + **since** | **Date** | Filter for emails that were received after the given timestamp | [optional] + **sort** | **String** | Sort direction | [optional] + **delay** | **Int64** | Max milliseconds delay between calls | [optional] + **timeout** | **Int64** | Max milliseconds to wait | [optional] + **unreadOnly** | **Bool** | Optional filter for unread only | [optional] [default to false] + +### Return type + +[**[EmailPreview]**](EmailPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForMatchingFirstEmail** +```swift + open class func waitForMatchingFirstEmail( inboxId: UUID, matchOptions: MatchOptions, timeout: Int64? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, sort: Sort_waitForMatchingFirstEmail? = nil, delay: Int64? = nil) -> Promise +``` + +Wait for or return the first email that matches provided MatchOptions array + +Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of the inbox we are matching an email for +let matchOptions = MatchOptions(matches: [MatchOption(field: "field_example", should: "should_example", value: "value_example")], conditions: [ConditionOption(condition: "condition_example", value: "value_example")]) // MatchOptions | +let timeout = 987 // Int64 | Max milliseconds to wait (optional) +let unreadOnly = true // Bool | Optional filter for unread only (optional) (default to false) +let since = Date() // Date | Filter for emails that were received after the given timestamp (optional) +let before = Date() // Date | Filter for emails that were received before the given timestamp (optional) +let sort = "sort_example" // String | Sort direction (optional) +let delay = 987 // Int64 | Max milliseconds delay between calls (optional) + +// Wait for or return the first email that matches provided MatchOptions array +WaitForControllerAPI.waitForMatchingFirstEmail(inboxId: inboxId, matchOptions: matchOptions, timeout: timeout, unreadOnly: unreadOnly, since: since, before: before, sort: sort, delay: delay).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of the inbox we are matching an email for | + **matchOptions** | [**MatchOptions**](MatchOptions) | | + **timeout** | **Int64** | Max milliseconds to wait | [optional] + **unreadOnly** | **Bool** | Optional filter for unread only | [optional] [default to false] + **since** | **Date** | Filter for emails that were received after the given timestamp | [optional] + **before** | **Date** | Filter for emails that were received before the given timestamp | [optional] + **sort** | **String** | Sort direction | [optional] + **delay** | **Int64** | Max milliseconds delay between calls | [optional] + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForNthEmail** +```swift + open class func waitForNthEmail( inboxId: UUID? = nil, index: Int? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, sort: Sort_waitForNthEmail? = nil, delay: Int64? = nil) -> Promise +``` + +Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. + +If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | Id of the inbox you are fetching emails from (optional) +let index = 987 // Int | Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional) (default to 0) +let timeout = 987 // Int64 | Max milliseconds to wait for the nth email if not already present (optional) +let unreadOnly = true // Bool | Optional filter for unread only (optional) (default to false) +let since = Date() // Date | Filter for emails that were received after the given timestamp (optional) +let before = Date() // Date | Filter for emails that were received before the given timestamp (optional) +let sort = "sort_example" // String | Sort direction (optional) +let delay = 987 // Int64 | Max milliseconds delay between calls (optional) + +// Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. +WaitForControllerAPI.waitForNthEmail(inboxId: inboxId, index: index, timeout: timeout, unreadOnly: unreadOnly, since: since, before: before, sort: sort, delay: delay).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | Id of the inbox you are fetching emails from | [optional] + **index** | **Int** | Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 | [optional] [default to 0] + **timeout** | **Int64** | Max milliseconds to wait for the nth email if not already present | [optional] + **unreadOnly** | **Bool** | Optional filter for unread only | [optional] [default to false] + **since** | **Date** | Filter for emails that were received after the given timestamp | [optional] + **before** | **Date** | Filter for emails that were received before the given timestamp | [optional] + **sort** | **String** | Sort direction | [optional] + **delay** | **Int64** | Max milliseconds delay between calls | [optional] + +### Return type + +[**Email**](Email) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **waitForSms** +```swift + open class func waitForSms( waitForSmsConditions: WaitForSmsConditions) -> Promise<[SmsPreview]> +``` + +Wait for an SMS message to match the provided filter conditions such as body contains keyword. + +Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let waitForSmsConditions = WaitForSmsConditions(phoneNumberId: 123, limit: 123, count: 123, delayTimeout: 123, timeout: 123, unreadOnly: false, countType: "countType_example", matches: [SmsMatchOption(field: "field_example", should: "should_example", value: "value_example")], sortDirection: "sortDirection_example", since: Date(), before: Date()) // WaitForSmsConditions | + +// Wait for an SMS message to match the provided filter conditions such as body contains keyword. +WaitForControllerAPI.waitForSms(waitForSmsConditions: waitForSmsConditions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waitForSmsConditions** | [**WaitForSmsConditions**](WaitForSmsConditions) | | + +### Return type + +[**[SmsPreview]**](SmsPreview) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/WaitForSingleSmsOptions.md b/docs/WaitForSingleSmsOptions.md new file mode 100644 index 00000000..9a79f29d --- /dev/null +++ b/docs/WaitForSingleSmsOptions.md @@ -0,0 +1,16 @@ +# WaitForSingleSmsOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**phoneNumberId** | **UUID** | | +**timeout** | **Int64** | | +**unreadOnly** | **Bool** | | [optional] +**before** | **Date** | | [optional] +**since** | **Date** | | [optional] +**sortDirection** | **String** | | [optional] +**delay** | **Int64** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WaitForSmsConditions.md b/docs/WaitForSmsConditions.md new file mode 100644 index 00000000..780cca8b --- /dev/null +++ b/docs/WaitForSmsConditions.md @@ -0,0 +1,20 @@ +# WaitForSmsConditions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**phoneNumberId** | **UUID** | ID of phone number to search within and apply conditions to. Essentially filtering the SMS found to give a count. | +**limit** | **Int** | Limit results | [optional] +**count** | **Int64** | Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation. | +**delayTimeout** | **Int64** | Max time in milliseconds to wait between retries if a `timeout` is specified. | [optional] +**timeout** | **Int64** | Max time in milliseconds to retry the `waitFor` operation until conditions are met. | +**unreadOnly** | **Bool** | Apply conditions only to **unread** SMS. All SMS messages begin with `read=false`. An SMS is marked `read=true` when an `SMS` has been returned to the user at least once. For example you have called `getSms` or `waitForSms` etc., or you have viewed the SMS in the dashboard. | [optional] +**countType** | **String** | How result size should be compared with the expected size. Exactly or at-least matching result? | [optional] +**matches** | [SmsMatchOption] | Conditions that should be matched for an SMS to qualify for results. Each condition will be applied in order to each SMS within a phone number to filter a result list of matching SMSs you are waiting for. | [optional] +**sortDirection** | **String** | Direction to sort matching SMSs by created time | [optional] +**since** | **Date** | ISO Date Time earliest time of SMS to consider. Filter for matching SMSs that were received after this date | [optional] +**before** | **Date** | ISO Date Time latest time of SMS to consider. Filter for matching SMSs that were received before this date | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookBouncePayload.md b/docs/WebhookBouncePayload.md new file mode 100644 index 00000000..9412d7ab --- /dev/null +++ b/docs/WebhookBouncePayload.md @@ -0,0 +1,17 @@ +# WebhookBouncePayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**bounceId** | **UUID** | ID of the bounce email record. Use the ID with the bounce controller to view more information | +**sentToRecipients** | **[String]** | | [optional] +**sender** | **String** | | +**bounceRecipients** | **[String]** | Email addresses that resulted in a bounce or email being rejected. Please save these recipients and avoid emailing them in the future to maintain your reputation. | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookBounceRecipientPayload.md b/docs/WebhookBounceRecipientPayload.md new file mode 100644 index 00000000..9acc46fc --- /dev/null +++ b/docs/WebhookBounceRecipientPayload.md @@ -0,0 +1,14 @@ +# WebhookBounceRecipientPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**recipient** | **String** | Email address that caused a bounce. Make note of the address and try not to message it again to preserve your reputation. | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookControllerAPI.md b/docs/WebhookControllerAPI.md new file mode 100644 index 00000000..8d7ea7ec --- /dev/null +++ b/docs/WebhookControllerAPI.md @@ -0,0 +1,1386 @@ +# WebhookControllerAPI + +All URIs are relative to *https://api.mailslurp.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createAccountWebhook**](WebhookControllerAPI#createaccountwebhook) | **POST** /webhooks | Attach a WebHook URL to an inbox +[**createWebhook**](WebhookControllerAPI#createwebhook) | **POST** /inboxes/{inboxId}/webhooks | Attach a WebHook URL to an inbox +[**createWebhookForPhoneNumber**](WebhookControllerAPI#createwebhookforphonenumber) | **POST** /phone/numbers/{phoneNumberId}/webhooks | Attach a WebHook URL to a phone number +[**deleteAllWebhooks**](WebhookControllerAPI#deleteallwebhooks) | **DELETE** /webhooks | Delete all webhooks +[**deleteWebhook**](WebhookControllerAPI#deletewebhook) | **DELETE** /inboxes/{inboxId}/webhooks/{webhookId} | Delete and disable a Webhook for an Inbox +[**deleteWebhookById**](WebhookControllerAPI#deletewebhookbyid) | **DELETE** /webhooks/{webhookId} | Delete a webhook +[**getAllWebhookResults**](WebhookControllerAPI#getallwebhookresults) | **GET** /webhooks/results | Get results for all webhooks +[**getAllWebhooks**](WebhookControllerAPI#getallwebhooks) | **GET** /webhooks/paginated | List Webhooks Paginated +[**getInboxWebhooksPaginated**](WebhookControllerAPI#getinboxwebhookspaginated) | **GET** /inboxes/{inboxId}/webhooks/paginated | Get paginated webhooks for an Inbox +[**getJsonSchemaForWebhookEvent**](WebhookControllerAPI#getjsonschemaforwebhookevent) | **POST** /webhooks/schema | +[**getJsonSchemaForWebhookPayload**](WebhookControllerAPI#getjsonschemaforwebhookpayload) | **POST** /webhooks/{webhookId}/schema | +[**getTestWebhookPayload**](WebhookControllerAPI#gettestwebhookpayload) | **GET** /webhooks/test | +[**getTestWebhookPayloadBounce**](WebhookControllerAPI#gettestwebhookpayloadbounce) | **GET** /webhooks/test/email-bounce-payload | +[**getTestWebhookPayloadBounceRecipient**](WebhookControllerAPI#gettestwebhookpayloadbouncerecipient) | **GET** /webhooks/test/email-bounce-recipient-payload | +[**getTestWebhookPayloadEmailOpened**](WebhookControllerAPI#gettestwebhookpayloademailopened) | **GET** /webhooks/test/email-opened-payload | +[**getTestWebhookPayloadEmailRead**](WebhookControllerAPI#gettestwebhookpayloademailread) | **GET** /webhooks/test/email-read-payload | +[**getTestWebhookPayloadForWebhook**](WebhookControllerAPI#gettestwebhookpayloadforwebhook) | **POST** /webhooks/{webhookId}/example | +[**getTestWebhookPayloadNewAttachment**](WebhookControllerAPI#gettestwebhookpayloadnewattachment) | **GET** /webhooks/test/new-attachment-payload | Get webhook test payload for new attachment event +[**getTestWebhookPayloadNewContact**](WebhookControllerAPI#gettestwebhookpayloadnewcontact) | **GET** /webhooks/test/new-contact-payload | Get webhook test payload for new contact event +[**getTestWebhookPayloadNewEmail**](WebhookControllerAPI#gettestwebhookpayloadnewemail) | **GET** /webhooks/test/new-email-payload | Get webhook test payload for new email event +[**getWebhook**](WebhookControllerAPI#getwebhook) | **GET** /webhooks/{webhookId} | Get a webhook +[**getWebhookResult**](WebhookControllerAPI#getwebhookresult) | **GET** /webhooks/results/{webhookResultId} | Get a webhook result for a webhook +[**getWebhookResults**](WebhookControllerAPI#getwebhookresults) | **GET** /webhooks/{webhookId}/results | Get a webhook results for a webhook +[**getWebhookResultsUnseenErrorCount**](WebhookControllerAPI#getwebhookresultsunseenerrorcount) | **GET** /webhooks/results/unseen-count | Get count of unseen webhook results with error status +[**getWebhooks**](WebhookControllerAPI#getwebhooks) | **GET** /inboxes/{inboxId}/webhooks | Get all webhooks for an Inbox +[**redriveWebhookResult**](WebhookControllerAPI#redrivewebhookresult) | **POST** /webhooks/results/{webhookResultId}/redrive | Get a webhook result and try to resend the original webhook payload +[**sendTestData**](WebhookControllerAPI#sendtestdata) | **POST** /webhooks/{webhookId}/test | Send webhook test data +[**updateWebhookHeaders**](WebhookControllerAPI#updatewebhookheaders) | **PUT** /webhooks/{webhookId}/headers | Update a webhook request headers +[**verifyWebhookSignature**](WebhookControllerAPI#verifywebhooksignature) | **POST** /webhooks/verify | Verify a webhook payload signature + + +# **createAccountWebhook** +```swift + open class func createAccountWebhook( createWebhookOptions: CreateWebhookOptions) -> Promise +``` + +Attach a WebHook URL to an inbox + +Get notified of account level events such as bounce and bounce recipient. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let createWebhookOptions = CreateWebhookOptions(url: "url_example", basicAuth: BasicAuthOptions(username: "username_example", password: "password_example"), name: "name_example", eventName: "eventName_example", includeHeaders: WebhookHeaders(headers: [WebhookHeaderNameValue(name: "name_example", value: "value_example")])) // CreateWebhookOptions | + +// Attach a WebHook URL to an inbox +WebhookControllerAPI.createAccountWebhook(createWebhookOptions: createWebhookOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createWebhookOptions** | [**CreateWebhookOptions**](CreateWebhookOptions) | | + +### Return type + +[**WebhookDto**](WebhookDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createWebhook** +```swift + open class func createWebhook( inboxId: UUID, createWebhookOptions: CreateWebhookOptions) -> Promise +``` + +Attach a WebHook URL to an inbox + +Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let createWebhookOptions = CreateWebhookOptions(url: "url_example", basicAuth: BasicAuthOptions(username: "username_example", password: "password_example"), name: "name_example", eventName: "eventName_example", includeHeaders: WebhookHeaders(headers: [WebhookHeaderNameValue(name: "name_example", value: "value_example")])) // CreateWebhookOptions | + +// Attach a WebHook URL to an inbox +WebhookControllerAPI.createWebhook(inboxId: inboxId, createWebhookOptions: createWebhookOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **createWebhookOptions** | [**CreateWebhookOptions**](CreateWebhookOptions) | | + +### Return type + +[**WebhookDto**](WebhookDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **createWebhookForPhoneNumber** +```swift + open class func createWebhookForPhoneNumber( phoneNumberId: UUID, createWebhookOptions: CreateWebhookOptions) -> Promise +``` + +Attach a WebHook URL to a phone number + +Get notified whenever a phone number receives an SMS via a WebHook URL. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let phoneNumberId = 987 // UUID | +let createWebhookOptions = CreateWebhookOptions(url: "url_example", basicAuth: BasicAuthOptions(username: "username_example", password: "password_example"), name: "name_example", eventName: "eventName_example", includeHeaders: WebhookHeaders(headers: [WebhookHeaderNameValue(name: "name_example", value: "value_example")])) // CreateWebhookOptions | + +// Attach a WebHook URL to a phone number +WebhookControllerAPI.createWebhookForPhoneNumber(phoneNumberId: phoneNumberId, createWebhookOptions: createWebhookOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **phoneNumberId** | [**UUID**]() | | + **createWebhookOptions** | [**CreateWebhookOptions**](CreateWebhookOptions) | | + +### Return type + +[**WebhookDto**](WebhookDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteAllWebhooks** +```swift + open class func deleteAllWebhooks( before: Date? = nil) -> Promise +``` + +Delete all webhooks + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let before = Date() // Date | before (optional) + +// Delete all webhooks +WebhookControllerAPI.deleteAllWebhooks(before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **before** | **Date** | before | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteWebhook** +```swift + open class func deleteWebhook( inboxId: UUID, webhookId: UUID) -> Promise +``` + +Delete and disable a Webhook for an Inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let webhookId = 987 // UUID | + +// Delete and disable a Webhook for an Inbox +WebhookControllerAPI.deleteWebhook(inboxId: inboxId, webhookId: webhookId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **webhookId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **deleteWebhookById** +```swift + open class func deleteWebhookById( webhookId: UUID) -> Promise +``` + +Delete a webhook + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | + +// Delete a webhook +WebhookControllerAPI.deleteWebhookById(webhookId: webhookId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | | + +### Return type + +Void (empty response body) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllWebhookResults** +```swift + open class func getAllWebhookResults( page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhookResults? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, unseenOnly: Bool? = nil) -> Promise +``` + +Get results for all webhooks + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) +let unseenOnly = true // Bool | Filter for unseen exceptions only (optional) + +// Get results for all webhooks +WebhookControllerAPI.getAllWebhookResults(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, unseenOnly: unseenOnly).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + **unseenOnly** | **Bool** | Filter for unseen exceptions only | [optional] + +### Return type + +[**PageWebhookResult**](PageWebhookResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getAllWebhooks** +```swift + open class func getAllWebhooks( page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhooks? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +List Webhooks Paginated + +List webhooks in paginated form. Allows for page index, page size, and sort direction. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size for paginated result list. (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .desc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// List Webhooks Paginated +WebhookControllerAPI.getAllWebhooks(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size for paginated result list. | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .desc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageWebhookProjection**](PageWebhookProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getInboxWebhooksPaginated** +```swift + open class func getInboxWebhooksPaginated( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxWebhooksPaginated? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> Promise +``` + +Get paginated webhooks for an Inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) + +// Get paginated webhooks for an Inbox +WebhookControllerAPI.getInboxWebhooksPaginated(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + +### Return type + +[**PageWebhookProjection**](PageWebhookProjection) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getJsonSchemaForWebhookEvent** +```swift + open class func getJsonSchemaForWebhookEvent( event: Event_getJsonSchemaForWebhookEvent) -> Promise +``` + + + +Get JSON Schema definition for webhook payload by event + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let event = "event_example" // String | + +WebhookControllerAPI.getJsonSchemaForWebhookEvent(event: event).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **event** | **String** | | + +### Return type + +[**JSONSchemaDto**](JSONSchemaDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getJsonSchemaForWebhookPayload** +```swift + open class func getJsonSchemaForWebhookPayload( webhookId: UUID) -> Promise +``` + + + +Get JSON Schema definition for webhook payload + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | + +WebhookControllerAPI.getJsonSchemaForWebhookPayload(webhookId: webhookId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | | + +### Return type + +[**JSONSchemaDto**](JSONSchemaDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayload** +```swift + open class func getTestWebhookPayload( eventName: EventName_getTestWebhookPayload? = nil) -> Promise +``` + + + +Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let eventName = "eventName_example" // String | (optional) + +WebhookControllerAPI.getTestWebhookPayload(eventName: eventName).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eventName** | **String** | | [optional] + +### Return type + +[**AbstractWebhookPayload**](AbstractWebhookPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadBounce** +```swift + open class func getTestWebhookPayloadBounce() -> Promise +``` + + + +Get webhook test payload for bounce + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +WebhookControllerAPI.getTestWebhookPayloadBounce().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookBouncePayload**](WebhookBouncePayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadBounceRecipient** +```swift + open class func getTestWebhookPayloadBounceRecipient() -> Promise +``` + + + +Get webhook test payload for bounce recipient + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +WebhookControllerAPI.getTestWebhookPayloadBounceRecipient().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookBounceRecipientPayload**](WebhookBounceRecipientPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadEmailOpened** +```swift + open class func getTestWebhookPayloadEmailOpened() -> Promise +``` + + + +Get webhook test payload for email opened event + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +WebhookControllerAPI.getTestWebhookPayloadEmailOpened().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookEmailOpenedPayload**](WebhookEmailOpenedPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadEmailRead** +```swift + open class func getTestWebhookPayloadEmailRead() -> Promise +``` + + + +Get webhook test payload for email opened event + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +WebhookControllerAPI.getTestWebhookPayloadEmailRead().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookEmailReadPayload**](WebhookEmailReadPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadForWebhook** +```swift + open class func getTestWebhookPayloadForWebhook( webhookId: UUID) -> Promise +``` + + + +Get example payload for webhook + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | + +WebhookControllerAPI.getTestWebhookPayloadForWebhook(webhookId: webhookId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | | + +### Return type + +[**AbstractWebhookPayload**](AbstractWebhookPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadNewAttachment** +```swift + open class func getTestWebhookPayloadNewAttachment() -> Promise +``` + +Get webhook test payload for new attachment event + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get webhook test payload for new attachment event +WebhookControllerAPI.getTestWebhookPayloadNewAttachment().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookNewAttachmentPayload**](WebhookNewAttachmentPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadNewContact** +```swift + open class func getTestWebhookPayloadNewContact() -> Promise +``` + +Get webhook test payload for new contact event + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get webhook test payload for new contact event +WebhookControllerAPI.getTestWebhookPayloadNewContact().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookNewContactPayload**](WebhookNewContactPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getTestWebhookPayloadNewEmail** +```swift + open class func getTestWebhookPayloadNewEmail() -> Promise +``` + +Get webhook test payload for new email event + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get webhook test payload for new email event +WebhookControllerAPI.getTestWebhookPayloadNewEmail().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WebhookNewEmailPayload**](WebhookNewEmailPayload) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getWebhook** +```swift + open class func getWebhook( webhookId: UUID) -> Promise +``` + +Get a webhook + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | + +// Get a webhook +WebhookControllerAPI.getWebhook(webhookId: webhookId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | | + +### Return type + +[**WebhookDto**](WebhookDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getWebhookResult** +```swift + open class func getWebhookResult( webhookResultId: UUID) -> Promise +``` + +Get a webhook result for a webhook + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookResultId = 987 // UUID | Webhook Result ID + +// Get a webhook result for a webhook +WebhookControllerAPI.getWebhookResult(webhookResultId: webhookResultId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookResultId** | [**UUID**]() | Webhook Result ID | + +### Return type + +[**WebhookResultDto**](WebhookResultDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getWebhookResults** +```swift + open class func getWebhookResults( webhookId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getWebhookResults? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, unseenOnly: Bool? = nil) -> Promise +``` + +Get a webhook results for a webhook + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | ID of webhook to get results for +let page = 987 // Int | Optional page index in list pagination (optional) (default to 0) +let size = 987 // Int | Optional page size in list pagination (optional) (default to 20) +let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc) +let searchFilter = "searchFilter_example" // String | Optional search filter (optional) +let since = Date() // Date | Filter by created at after the given timestamp (optional) +let before = Date() // Date | Filter by created at before the given timestamp (optional) +let unseenOnly = true // Bool | Filter for unseen exceptions only (optional) + +// Get a webhook results for a webhook +WebhookControllerAPI.getWebhookResults(webhookId: webhookId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, unseenOnly: unseenOnly).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | ID of webhook to get results for | + **page** | **Int** | Optional page index in list pagination | [optional] [default to 0] + **size** | **Int** | Optional page size in list pagination | [optional] [default to 20] + **sort** | **String** | Optional createdAt sort direction ASC or DESC | [optional] [default to .asc] + **searchFilter** | **String** | Optional search filter | [optional] + **since** | **Date** | Filter by created at after the given timestamp | [optional] + **before** | **Date** | Filter by created at before the given timestamp | [optional] + **unseenOnly** | **Bool** | Filter for unseen exceptions only | [optional] + +### Return type + +[**PageWebhookResult**](PageWebhookResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getWebhookResultsUnseenErrorCount** +```swift + open class func getWebhookResultsUnseenErrorCount() -> Promise +``` + +Get count of unseen webhook results with error status + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + + +// Get count of unseen webhook results with error status +WebhookControllerAPI.getWebhookResultsUnseenErrorCount().then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UnseenErrorCountDto**](UnseenErrorCountDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **getWebhooks** +```swift + open class func getWebhooks( inboxId: UUID) -> Promise<[WebhookDto]> +``` + +Get all webhooks for an Inbox + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let inboxId = 987 // UUID | + +// Get all webhooks for an Inbox +WebhookControllerAPI.getWebhooks(inboxId: inboxId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inboxId** | [**UUID**]() | | + +### Return type + +[**[WebhookDto]**](WebhookDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **redriveWebhookResult** +```swift + open class func redriveWebhookResult( webhookResultId: UUID) -> Promise +``` + +Get a webhook result and try to resend the original webhook payload + +Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookResultId = 987 // UUID | Webhook Result ID + +// Get a webhook result and try to resend the original webhook payload +WebhookControllerAPI.redriveWebhookResult(webhookResultId: webhookResultId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookResultId** | [**UUID**]() | Webhook Result ID | + +### Return type + +[**WebhookRedriveResult**](WebhookRedriveResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **sendTestData** +```swift + open class func sendTestData( webhookId: UUID) -> Promise +``` + +Send webhook test data + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | + +// Send webhook test data +WebhookControllerAPI.sendTestData(webhookId: webhookId).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | | + +### Return type + +[**WebhookTestResult**](WebhookTestResult) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **updateWebhookHeaders** +```swift + open class func updateWebhookHeaders( webhookId: UUID, webhookHeaders: WebhookHeaders) -> Promise +``` + +Update a webhook request headers + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let webhookId = 987 // UUID | +let webhookHeaders = WebhookHeaders(headers: [WebhookHeaderNameValue(name: "name_example", value: "value_example")]) // WebhookHeaders | + +// Update a webhook request headers +WebhookControllerAPI.updateWebhookHeaders(webhookId: webhookId, webhookHeaders: webhookHeaders).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookId** | [**UUID**]() | | + **webhookHeaders** | [**WebhookHeaders**](WebhookHeaders) | | + +### Return type + +[**WebhookDto**](WebhookDto) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + +# **verifyWebhookSignature** +```swift + open class func verifyWebhookSignature( verifyWebhookSignatureOptions: VerifyWebhookSignatureOptions) -> Promise +``` + +Verify a webhook payload signature + +Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import mailslurp + +let verifyWebhookSignatureOptions = VerifyWebhookSignatureOptions(messageId: "messageId_example", signature: "signature_example") // VerifyWebhookSignatureOptions | + +// Verify a webhook payload signature +WebhookControllerAPI.verifyWebhookSignature(verifyWebhookSignatureOptions: verifyWebhookSignatureOptions).then { + // when the promise is fulfilled + }.always { + // regardless of whether the promise is fulfilled, or rejected + }.catch { errorType in + // when the promise is rejected +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **verifyWebhookSignatureOptions** | [**VerifyWebhookSignatureOptions**](VerifyWebhookSignatureOptions) | | + +### Return type + +[**VerifyWebhookSignatureResults**](VerifyWebhookSignatureResults) + +### Authorization + +[API_KEY](../README#API_KEY) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to Model list]](../README#documentation-for-models) [[Back to README]](../README) + diff --git a/docs/WebhookDto.md b/docs/WebhookDto.md new file mode 100644 index 00000000..b9fe32fb --- /dev/null +++ b/docs/WebhookDto.md @@ -0,0 +1,21 @@ +# WebhookDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | ID of the Webhook | +**userId** | **UUID** | User ID of the Webhook | +**basicAuth** | **Bool** | Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself. | +**name** | **String** | Name of the webhook | [optional] +**inboxId** | **UUID** | The inbox that the Webhook will be triggered by. If null then webhook triggered at account level | [optional] +**url** | **String** | URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema. | +**method** | **String** | HTTP method that your server endpoint must listen for | +**payloadJsonSchema** | **String** | Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method | +**createdAt** | **Date** | When the webhook was created | +**updatedAt** | **Date** | | +**eventName** | **String** | Webhook trigger event name | [optional] +**requestHeaders** | [**WebhookHeaders**](WebhookHeaders) | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookEmailOpenedPayload.md b/docs/WebhookEmailOpenedPayload.md new file mode 100644 index 00000000..928d132a --- /dev/null +++ b/docs/WebhookEmailOpenedPayload.md @@ -0,0 +1,18 @@ +# WebhookEmailOpenedPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**inboxId** | **UUID** | Id of the inbox that received an email | +**pixelId** | **UUID** | ID of the tracking pixel | +**sentEmailId** | **UUID** | ID of sent email | +**recipient** | **String** | Email address for the recipient of the tracking pixel | +**createdAt** | **Date** | Date time of event creation | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookEmailReadPayload.md b/docs/WebhookEmailReadPayload.md new file mode 100644 index 00000000..ae391c47 --- /dev/null +++ b/docs/WebhookEmailReadPayload.md @@ -0,0 +1,17 @@ +# WebhookEmailReadPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**emailId** | **UUID** | ID of the email that was received. Use this ID for fetching the email with the `EmailController`. | +**inboxId** | **UUID** | Id of the inbox that received an email | +**emailIsRead** | **Bool** | Is the email read | +**createdAt** | **Date** | Date time of event creation | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookHeaderNameValue.md b/docs/WebhookHeaderNameValue.md new file mode 100644 index 00000000..5a7231d0 --- /dev/null +++ b/docs/WebhookHeaderNameValue.md @@ -0,0 +1,11 @@ +# WebhookHeaderNameValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of header | +**value** | **String** | Value of header | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookHeaders.md b/docs/WebhookHeaders.md new file mode 100644 index 00000000..c1729910 --- /dev/null +++ b/docs/WebhookHeaders.md @@ -0,0 +1,10 @@ +# WebhookHeaders + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**headers** | [WebhookHeaderNameValue] | List of header name value pairs to include with webhook requests | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookNewAttachmentPayload.md b/docs/WebhookNewAttachmentPayload.md new file mode 100644 index 00000000..50e5a992 --- /dev/null +++ b/docs/WebhookNewAttachmentPayload.md @@ -0,0 +1,17 @@ +# WebhookNewAttachmentPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**attachmentId** | **String** | ID of attachment. Use the `AttachmentController` to | +**name** | **String** | Filename of the attachment if present | +**contentType** | **String** | Content type of attachment such as 'image/png' or 'application/pdf | +**contentLength** | **Int64** | Size of attachment in bytes | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookNewContactPayload.md b/docs/WebhookNewContactPayload.md new file mode 100644 index 00000000..c4bb75ee --- /dev/null +++ b/docs/WebhookNewContactPayload.md @@ -0,0 +1,24 @@ +# WebhookNewContactPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**contactId** | **UUID** | | +**groupId** | **UUID** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**company** | **String** | | [optional] +**primaryEmailAddress** | **String** | | [optional] +**emailAddresses** | **[String]** | | +**tags** | **[String]** | | +**metaData** | [**AnyCodable**]() | | [optional] +**optOut** | **Bool** | | +**createdAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookNewEmailPayload.md b/docs/WebhookNewEmailPayload.md new file mode 100644 index 00000000..a79bb501 --- /dev/null +++ b/docs/WebhookNewEmailPayload.md @@ -0,0 +1,23 @@ +# WebhookNewEmailPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageId** | **String** | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. | +**webhookId** | **UUID** | ID of webhook entity being triggered | +**eventName** | **String** | Name of the event type webhook is being triggered for. | +**webhookName** | **String** | Name of the webhook being triggered | [optional] +**inboxId** | **UUID** | Id of the inbox that received an email | +**domainId** | **UUID** | Id of the domain that received an email | [optional] +**emailId** | **UUID** | ID of the email that was received. Use this ID for fetching the email with the `EmailController`. | +**createdAt** | **Date** | Date time of event creation | +**to** | **[String]** | List of `To` recipient email addresses that the email was addressed to. See recipients object for names. | +**from** | **String** | Who the email was sent from. An email address - see fromName for the sender name. | +**cc** | **[String]** | List of `CC` recipients email addresses that the email was addressed to. See recipients object for names. | +**bcc** | **[String]** | List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names. | +**subject** | **String** | The subject line of the email message as specified by SMTP subject header | [optional] +**attachmentMetaDatas** | [AttachmentMetaData] | List of attachment meta data objects if attachments present | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookProjection.md b/docs/WebhookProjection.md new file mode 100644 index 00000000..192c530d --- /dev/null +++ b/docs/WebhookProjection.md @@ -0,0 +1,16 @@ +# WebhookProjection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**_id** | **UUID** | | +**url** | **String** | | +**inboxId** | **UUID** | | [optional] +**eventName** | **String** | | [optional] +**createdAt** | **Date** | | +**updatedAt** | **Date** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookRedriveResult.md b/docs/WebhookRedriveResult.md new file mode 100644 index 00000000..9a6524d7 --- /dev/null +++ b/docs/WebhookRedriveResult.md @@ -0,0 +1,12 @@ +# WebhookRedriveResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**webhookResultId** | **UUID** | | +**success** | **Bool** | | +**message** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookResultDto.md b/docs/WebhookResultDto.md new file mode 100644 index 00000000..92388ac1 --- /dev/null +++ b/docs/WebhookResultDto.md @@ -0,0 +1,25 @@ +# WebhookResultDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **UUID** | | [optional] +**userId** | **UUID** | | +**inboxId** | **UUID** | | [optional] +**webhookId** | **UUID** | | +**webhookUrl** | **String** | | +**messageId** | **String** | | +**redriveId** | **UUID** | | [optional] +**httpMethod** | **String** | | +**webhookEvent** | **String** | | +**responseStatus** | **Int** | | [optional] +**responseTimeMillis** | **Int64** | | +**responseBodyExtract** | **String** | | [optional] +**resultType** | **String** | | [optional] +**createdAt** | **Date** | | +**updatedAt** | **Date** | | +**seen** | **Bool** | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookTestRequest.md b/docs/WebhookTestRequest.md new file mode 100644 index 00000000..d574fb27 --- /dev/null +++ b/docs/WebhookTestRequest.md @@ -0,0 +1,13 @@ +# WebhookTestRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **String** | | +**method** | **String** | | +**headers** | **[String: String]** | | +**payload** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookTestResponse.md b/docs/WebhookTestResponse.md new file mode 100644 index 00000000..8335f241 --- /dev/null +++ b/docs/WebhookTestResponse.md @@ -0,0 +1,11 @@ +# WebhookTestResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statusCode** | **Int** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/docs/WebhookTestResult.md b/docs/WebhookTestResult.md new file mode 100644 index 00000000..0944171e --- /dev/null +++ b/docs/WebhookTestResult.md @@ -0,0 +1,12 @@ +# WebhookTestResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] +**response** | [**WebhookTestResponse**](WebhookTestResponse) | | +**request** | [**WebhookTestRequest**](WebhookTestRequest) | | + +[[Back to Model list]](../README#documentation-for-models) [[Back to API list]](../README#documentation-for-api-endpoints) [[Back to README]](../README) + + diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 00000000..ced3be2b --- /dev/null +++ b/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/mailslurp.podspec b/mailslurp.podspec new file mode 100644 index 00000000..f268a750 --- /dev/null +++ b/mailslurp.podspec @@ -0,0 +1,17 @@ +Pod::Spec.new do |s| + s.name = 'mailslurp' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '3.0' + s.version = '15.13.4' + s.source = { :git => 'git@github.com:mailslurp/mailslurp-client-swift.git', :tag => '15.13.4' } + s.authors = 'mailslurp' + s.license = { :type => 'MIT' } + s.homepage = 'https://www.mailslurp.com' + s.summary = 'mailslurp Swift SDK' + s.documentation_url = 'https://docs.mailslurp.com/swift/' + s.source_files = 'mailslurp/**/*.swift' + s.dependency 'PromiseKit/CorePromise', '~> 6.13.1' + s.dependency 'AnyCodable-FlightSchool', '~> 0.4.0' +end diff --git a/mailslurp/APIHelper.swift b/mailslurp/APIHelper.swift new file mode 100644 index 00000000..f7bb5274 --- /dev/null +++ b/mailslurp/APIHelper.swift @@ -0,0 +1,71 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + let destination = source.reduce(into: [String: Any]()) { result, item in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + return source.reduce(into: [String: String]()) { result, item in + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any]()) { result, item in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + } + } + + public static func mapValueToPathItem(_ source: Any) -> Any { + if let collection = source as? [Any?] { + return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + } + return source + } + + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in + if let collection = item.value as? [Any?] { + collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} diff --git a/mailslurp/APIs.swift b/mailslurp/APIs.swift new file mode 100644 index 00000000..b212e865 --- /dev/null +++ b/mailslurp/APIs.swift @@ -0,0 +1,62 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class mailslurpAPI { + public static var basePath = "https://api.mailslurp.com" + public static var credential: URLCredential? + public static var customHeaders: [String: String] = [:] + public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() + public static var apiResponseQueue: DispatchQueue = .main +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String: String] + public let parameters: [String: Any]? + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. + /// If you need to get the request's progress in older OS versions, please use Alamofire http client. + public var onProgressReady: ((Progress) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.headers = headers + + addHeaders(mailslurpAPI.customHeaders) + } + + open func addHeaders(_ aHeaders: [String: String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + credential = mailslurpAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/mailslurp/APIs/AliasControllerAPI.swift b/mailslurp/APIs/AliasControllerAPI.swift new file mode 100644 index 00000000..5d206536 --- /dev/null +++ b/mailslurp/APIs/AliasControllerAPI.swift @@ -0,0 +1,547 @@ +// +// AliasControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class AliasControllerAPI : NSObject { + /** + Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. + + - parameter createAliasOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createAlias( createAliasOptions: CreateAliasOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createAliasWithRequestBuilder(createAliasOptions: createAliasOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. + - POST /aliases + - Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createAliasOptions: (body) + - returns: RequestBuilder + */ + open class func createAliasWithRequestBuilder(createAliasOptions: CreateAliasOptions) -> RequestBuilder { + let path = "/aliases" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createAliasOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete an email alias + + - parameter aliasId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAlias( aliasId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAliasWithRequestBuilder(aliasId: aliasId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete an email alias + - DELETE /aliases/{aliasId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) + - returns: RequestBuilder + */ + open class func deleteAliasWithRequestBuilder(aliasId: UUID) -> RequestBuilder { + var path = "/aliases/{aliasId}" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get an email alias + + - parameter aliasId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAlias( aliasId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAliasWithRequestBuilder(aliasId: aliasId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get an email alias + - GET /aliases/{aliasId} + - Get an email alias by ID + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) + - returns: RequestBuilder + */ + open class func getAliasWithRequestBuilder(aliasId: UUID) -> RequestBuilder { + var path = "/aliases/{aliasId}" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAliasEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get emails for an alias + + - parameter aliasId: (path) + - parameter page: (query) Optional page index alias email list pagination (optional, default to 0) + - parameter size: (query) Optional page size alias email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by sent after given date time (optional) + - parameter before: (query) Optional filter by sent before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAliasEmails( aliasId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getAliasEmails? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAliasEmailsWithRequestBuilder(aliasId: aliasId, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get emails for an alias + - GET /aliases/{aliasId}/emails + - Get paginated emails for an alias by ID + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) + - parameter page: (query) Optional page index alias email list pagination (optional, default to 0) + - parameter size: (query) Optional page size alias email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by sent after given date time (optional) + - parameter before: (query) Optional filter by sent before given date time (optional) + - returns: RequestBuilder + */ + open class func getAliasEmailsWithRequestBuilder(aliasId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getAliasEmails? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/aliases/{aliasId}/emails" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAliasThreads: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get threads created for an alias + + - parameter aliasId: (path) + - parameter page: (query) Optional page index in thread list pagination (optional, default to 0) + - parameter size: (query) Optional page size in thread list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by sent after given date time (optional) + - parameter before: (query) Optional filter by sent before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAliasThreads( aliasId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getAliasThreads? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAliasThreadsWithRequestBuilder(aliasId: aliasId, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get threads created for an alias + - GET /aliases/{aliasId}/threads + - Returns threads created for an email alias in paginated form + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) + - parameter page: (query) Optional page index in thread list pagination (optional, default to 0) + - parameter size: (query) Optional page size in thread list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by sent after given date time (optional) + - parameter before: (query) Optional filter by sent before given date time (optional) + - returns: RequestBuilder + */ + open class func getAliasThreadsWithRequestBuilder(aliasId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getAliasThreads? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/aliases/{aliasId}/threads" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAliases: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all email aliases you have created + + - parameter page: (query) Optional page index in alias list pagination (optional, default to 0) + - parameter size: (query) Optional page size in alias list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAliases( page: Int? = nil, size: Int? = nil, sort: Sort_getAliases? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAliasesWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all email aliases you have created + - GET /aliases + - Get all email aliases in paginated form + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in alias list pagination (optional, default to 0) + - parameter size: (query) Optional page size in alias list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAliasesWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAliases? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/aliases" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Reply to an email + + - parameter aliasId: (path) ID of the alias that email belongs to + - parameter emailId: (path) ID of the email that should be replied to + - parameter replyToAliasEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func replyToAliasEmail( aliasId: UUID, emailId: UUID, replyToAliasEmailOptions: ReplyToAliasEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + replyToAliasEmailWithRequestBuilder(aliasId: aliasId, emailId: emailId, replyToAliasEmailOptions: replyToAliasEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Reply to an email + - PUT /aliases/{aliasId}/emails/{emailId} + - Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) ID of the alias that email belongs to + - parameter emailId: (path) ID of the email that should be replied to + - parameter replyToAliasEmailOptions: (body) + - returns: RequestBuilder + */ + open class func replyToAliasEmailWithRequestBuilder(aliasId: UUID, emailId: UUID, replyToAliasEmailOptions: ReplyToAliasEmailOptions) -> RequestBuilder { + var path = "/aliases/{aliasId}/emails/{emailId}" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: replyToAliasEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send an email from an alias inbox + + - parameter aliasId: (path) + - parameter sendEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendAliasEmail( aliasId: UUID, sendEmailOptions: SendEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendAliasEmailWithRequestBuilder(aliasId: aliasId, sendEmailOptions: sendEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send an email from an alias inbox + - POST /aliases/{aliasId}/emails + - Send an email from an alias. Replies to the email will be forwarded to the alias masked email address + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) + - parameter sendEmailOptions: (body) + - returns: RequestBuilder + */ + open class func sendAliasEmailWithRequestBuilder(aliasId: UUID, sendEmailOptions: SendEmailOptions) -> RequestBuilder { + var path = "/aliases/{aliasId}/emails" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: sendEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Update an email alias + + - parameter aliasId: (path) + - parameter updateAliasOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func updateAlias( aliasId: UUID, updateAliasOptions: UpdateAliasOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + updateAliasWithRequestBuilder(aliasId: aliasId, updateAliasOptions: updateAliasOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Update an email alias + - PUT /aliases/{aliasId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter aliasId: (path) + - parameter updateAliasOptions: (body) + - returns: RequestBuilder + */ + open class func updateAliasWithRequestBuilder(aliasId: UUID, updateAliasOptions: UpdateAliasOptions) -> RequestBuilder { + var path = "/aliases/{aliasId}" + let aliasIdPreEscape = "\(APIHelper.mapValueToPathItem(aliasId))" + let aliasIdPostEscape = aliasIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{aliasId}", with: aliasIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateAliasOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/ApiUserControllerAPI.swift b/mailslurp/APIs/ApiUserControllerAPI.swift new file mode 100644 index 00000000..3138a5ae --- /dev/null +++ b/mailslurp/APIs/ApiUserControllerAPI.swift @@ -0,0 +1,141 @@ +// +// ApiUserControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class ApiUserControllerAPI : NSObject { + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSmtpPassword(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSmtpPasswordWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /user/smtp/password + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getSmtpPasswordWithRequestBuilder() -> RequestBuilder { + let path = "/user/smtp/password" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSmtpUsername(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSmtpUsernameWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /user/smtp/username + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getSmtpUsernameWithRequestBuilder() -> RequestBuilder { + let path = "/user/smtp/username" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getUserInfo(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getUserInfoWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /user/info + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getUserInfoWithRequestBuilder() -> RequestBuilder { + let path = "/user/info" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/AttachmentControllerAPI.swift b/mailslurp/APIs/AttachmentControllerAPI.swift new file mode 100644 index 00000000..b1aab83a --- /dev/null +++ b/mailslurp/APIs/AttachmentControllerAPI.swift @@ -0,0 +1,543 @@ +// +// AttachmentControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class AttachmentControllerAPI : NSObject { + /** + Delete all attachments + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAllAttachments(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAllAttachmentsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all attachments + - DELETE /attachments + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func deleteAllAttachmentsWithRequestBuilder() -> RequestBuilder { + let path = "/attachments" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete an attachment + + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAttachment( attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAttachmentWithRequestBuilder(attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete an attachment + - DELETE /attachments/{attachmentId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func deleteAttachmentWithRequestBuilder(attachmentId: String) -> RequestBuilder { + var path = "/attachments/{attachmentId}" + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. + + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func downloadAttachmentAsBase64Encoded( attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + downloadAttachmentAsBase64EncodedWithRequestBuilder(attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. + - GET /attachments/{attachmentId}/base64 + - Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func downloadAttachmentAsBase64EncodedWithRequestBuilder(attachmentId: String) -> RequestBuilder { + var path = "/attachments/{attachmentId}/base64" + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. + + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func downloadAttachmentAsBytes( attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + downloadAttachmentAsBytesWithRequestBuilder(attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. + - GET /attachments/{attachmentId}/bytes + - Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func downloadAttachmentAsBytesWithRequestBuilder(attachmentId: String) -> RequestBuilder { + var path = "/attachments/{attachmentId}/bytes" + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get an attachment entity + + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAttachment( attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAttachmentWithRequestBuilder(attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get an attachment entity + - GET /attachments/{attachmentId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func getAttachmentWithRequestBuilder(attachmentId: String) -> RequestBuilder { + var path = "/attachments/{attachmentId}" + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email attachment metadata information + + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAttachmentInfo( attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAttachmentInfoWithRequestBuilder(attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email attachment metadata information + - GET /attachments/{attachmentId}/metadata + - Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func getAttachmentInfoWithRequestBuilder(attachmentId: String) -> RequestBuilder { + var path = "/attachments/{attachmentId}/metadata" + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAttachments: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get email attachments + + - parameter page: (query) Optional page index for list pagination (optional, default to 0) + - parameter size: (query) Optional page size for list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter fileNameFilter: (query) Optional file name and content type search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAttachments( page: Int? = nil, size: Int? = nil, sort: Sort_getAttachments? = nil, fileNameFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAttachmentsWithRequestBuilder(page: page, size: size, sort: sort, fileNameFilter: fileNameFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email attachments + - GET /attachments + - Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index for list pagination (optional, default to 0) + - parameter size: (query) Optional page size for list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter fileNameFilter: (query) Optional file name and content type search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAttachmentsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAttachments? = nil, fileNameFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/attachments" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "fileNameFilter": fileNameFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. + + - parameter uploadAttachmentOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[String]> + */ + open class func uploadAttachment( uploadAttachmentOptions: UploadAttachmentOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[String]> { + let deferred = Promise<[String]>.pending() + uploadAttachmentWithRequestBuilder(uploadAttachmentOptions: uploadAttachmentOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. + - POST /attachments + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter uploadAttachmentOptions: (body) + - returns: RequestBuilder<[String]> + */ + open class func uploadAttachmentWithRequestBuilder(uploadAttachmentOptions: UploadAttachmentOptions) -> RequestBuilder<[String]> { + let path = "/attachments" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: uploadAttachmentOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[String]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment. + + - parameter inlineObject1: (body) + - parameter contentType: (header) Optional contentType for file. For instance `application/pdf` (optional) + - parameter filename: (query) Optional filename to save upload with (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[String]> + */ + open class func uploadAttachmentBytes( inlineObject1: InlineObject1, contentType: String? = nil, filename: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[String]> { + let deferred = Promise<[String]>.pending() + uploadAttachmentBytesWithRequestBuilder(inlineObject1: inlineObject1, contentType: contentType, filename: filename).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment. + - POST /attachments/bytes + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inlineObject1: (body) + - parameter contentType: (header) Optional contentType for file. For instance `application/pdf` (optional) + - parameter filename: (query) Optional filename to save upload with (optional) + - returns: RequestBuilder<[String]> + */ + open class func uploadAttachmentBytesWithRequestBuilder(inlineObject1: InlineObject1, contentType: String? = nil, filename: String? = nil) -> RequestBuilder<[String]> { + let path = "/attachments/bytes" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: inlineObject1) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "filename": filename?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + "contentType": contentType?.encodeToJSON(), + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[String]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. + + - parameter contentType: (query) Optional content type of attachment (optional) + - parameter filename: (query) Optional name of file (optional) + - parameter xFilename: (query) Optional content type header of attachment (optional) + - parameter inlineObject: (body) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[String]> + */ + open class func uploadMultipartForm( contentType: String? = nil, filename: String? = nil, xFilename: String? = nil, inlineObject: InlineObject? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[String]> { + let deferred = Promise<[String]>.pending() + uploadMultipartFormWithRequestBuilder(contentType: contentType, filename: filename, xFilename: xFilename, inlineObject: inlineObject).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. + - POST /attachments/multipart + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter contentType: (query) Optional content type of attachment (optional) + - parameter filename: (query) Optional name of file (optional) + - parameter xFilename: (query) Optional content type header of attachment (optional) + - parameter inlineObject: (body) (optional) + - returns: RequestBuilder<[String]> + */ + open class func uploadMultipartFormWithRequestBuilder(contentType: String? = nil, filename: String? = nil, xFilename: String? = nil, inlineObject: InlineObject? = nil) -> RequestBuilder<[String]> { + let path = "/attachments/multipart" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: inlineObject) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "contentType": contentType?.encodeToJSON(), + "filename": filename?.encodeToJSON(), + "x-filename": xFilename?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[String]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/BounceControllerAPI.swift b/mailslurp/APIs/BounceControllerAPI.swift new file mode 100644 index 00000000..8dbe72ac --- /dev/null +++ b/mailslurp/APIs/BounceControllerAPI.swift @@ -0,0 +1,375 @@ +// +// BounceControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class BounceControllerAPI : NSObject { + /** + Filter a list of email recipients and remove those who have bounced + + - parameter filterBouncedRecipientsOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func filterBouncedRecipient( filterBouncedRecipientsOptions: FilterBouncedRecipientsOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + filterBouncedRecipientWithRequestBuilder(filterBouncedRecipientsOptions: filterBouncedRecipientsOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Filter a list of email recipients and remove those who have bounced + - POST /bounce/filter-recipients + - Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter filterBouncedRecipientsOptions: (body) + - returns: RequestBuilder + */ + open class func filterBouncedRecipientWithRequestBuilder(filterBouncedRecipientsOptions: FilterBouncedRecipientsOptions) -> RequestBuilder { + let path = "/bounce/filter-recipients" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: filterBouncedRecipientsOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get a bounced email. + + - parameter _id: (path) ID of the bounced email to fetch + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getBouncedEmail( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getBouncedEmailWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a bounced email. + - GET /bounce/emails/{id} + - Bounced emails are email you have sent that were rejected by a recipient + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of the bounced email to fetch + - returns: RequestBuilder + */ + open class func getBouncedEmailWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/bounce/emails/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getBouncedEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get paginated list of bounced emails. + + - parameter page: (query) Optional page index (optional, default to 0) + - parameter size: (query) Optional page size (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getBouncedEmails( page: Int? = nil, size: Int? = nil, sort: Sort_getBouncedEmails? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getBouncedEmailsWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get paginated list of bounced emails. + - GET /bounce/emails + - Bounced emails are email you have sent that were rejected by a recipient + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index (optional, default to 0) + - parameter size: (query) Optional page size (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getBouncedEmailsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getBouncedEmails? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/bounce/emails" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get a bounced email. + + - parameter _id: (path) ID of the bounced recipient + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getBouncedRecipient( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getBouncedRecipientWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a bounced email. + - GET /bounce/recipients/{id} + - Bounced emails are email you have sent that were rejected by a recipient + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of the bounced recipient + - returns: RequestBuilder + */ + open class func getBouncedRecipientWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/bounce/recipients/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getBouncedRecipients: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get paginated list of bounced recipients. + + - parameter page: (query) Optional page index (optional, default to 0) + - parameter size: (query) Optional page size (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getBouncedRecipients( page: Int? = nil, size: Int? = nil, sort: Sort_getBouncedRecipients? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getBouncedRecipientsWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get paginated list of bounced recipients. + - GET /bounce/recipients + - Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index (optional, default to 0) + - parameter size: (query) Optional page size (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getBouncedRecipientsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getBouncedRecipients? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/bounce/recipients" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getComplaints: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get paginated list of complaints. + + - parameter page: (query) Optional page index (optional, default to 0) + - parameter size: (query) Optional page size (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getComplaints( page: Int? = nil, size: Int? = nil, sort: Sort_getComplaints? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getComplaintsWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get paginated list of complaints. + - GET /bounce/complaints + - SMTP complaints made against your account + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index (optional, default to 0) + - parameter size: (query) Optional page size (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getComplaintsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getComplaints? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/bounce/complaints" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/BulkActionsControllerAPI.swift b/mailslurp/APIs/BulkActionsControllerAPI.swift new file mode 100644 index 00000000..14e55c09 --- /dev/null +++ b/mailslurp/APIs/BulkActionsControllerAPI.swift @@ -0,0 +1,156 @@ +// +// BulkActionsControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class BulkActionsControllerAPI : NSObject { + /** + Bulk create Inboxes (email addresses) + + - parameter count: (query) Number of inboxes to be created in bulk + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[InboxDto]> + */ + open class func bulkCreateInboxes( count: Int, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[InboxDto]> { + let deferred = Promise<[InboxDto]>.pending() + bulkCreateInboxesWithRequestBuilder(count: count).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Bulk create Inboxes (email addresses) + - POST /bulk/inboxes + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter count: (query) Number of inboxes to be created in bulk + - returns: RequestBuilder<[InboxDto]> + */ + open class func bulkCreateInboxesWithRequestBuilder(count: Int) -> RequestBuilder<[InboxDto]> { + let path = "/bulk/inboxes" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "count": count.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[InboxDto]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Bulk Delete Inboxes + + - parameter requestBody: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func bulkDeleteInboxes( requestBody: [UUID], apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + bulkDeleteInboxesWithRequestBuilder(requestBody: requestBody).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Bulk Delete Inboxes + - DELETE /bulk/inboxes + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter requestBody: (body) + - returns: RequestBuilder + */ + open class func bulkDeleteInboxesWithRequestBuilder(requestBody: [UUID]) -> RequestBuilder { + let path = "/bulk/inboxes" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: requestBody) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Bulk Send Emails + + - parameter bulkSendEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func bulkSendEmails( bulkSendEmailOptions: BulkSendEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + bulkSendEmailsWithRequestBuilder(bulkSendEmailOptions: bulkSendEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Bulk Send Emails + - POST /bulk/send + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter bulkSendEmailOptions: (body) + - returns: RequestBuilder + */ + open class func bulkSendEmailsWithRequestBuilder(bulkSendEmailOptions: BulkSendEmailOptions) -> RequestBuilder { + let path = "/bulk/send" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: bulkSendEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/CommonActionsControllerAPI.swift b/mailslurp/APIs/CommonActionsControllerAPI.swift new file mode 100644 index 00000000..c6e9ce8a --- /dev/null +++ b/mailslurp/APIs/CommonActionsControllerAPI.swift @@ -0,0 +1,340 @@ +// +// CommonActionsControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class CommonActionsControllerAPI : NSObject { + /** + * enum for parameter inboxType + */ + public enum InboxType_createNewEmailAddress: String, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + + /** + Create new random inbox + + - parameter allowTeamAccess: (query) (optional) + - parameter useDomainPool: (query) (optional) + - parameter expiresAt: (query) (optional) + - parameter expiresIn: (query) (optional) + - parameter emailAddress: (query) (optional) + - parameter inboxType: (query) (optional) + - parameter _description: (query) (optional) + - parameter name: (query) (optional) + - parameter tags: (query) (optional) + - parameter favourite: (query) (optional) + - parameter virtualInbox: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createNewEmailAddress( allowTeamAccess: Bool? = nil, useDomainPool: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, emailAddress: String? = nil, inboxType: InboxType_createNewEmailAddress? = nil, _description: String? = nil, name: String? = nil, tags: [String]? = nil, favourite: Bool? = nil, virtualInbox: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createNewEmailAddressWithRequestBuilder(allowTeamAccess: allowTeamAccess, useDomainPool: useDomainPool, expiresAt: expiresAt, expiresIn: expiresIn, emailAddress: emailAddress, inboxType: inboxType, _description: _description, name: name, tags: tags, favourite: favourite, virtualInbox: virtualInbox).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create new random inbox + - POST /newEmailAddress + - Returns an Inbox with an `id` and an `emailAddress` + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter allowTeamAccess: (query) (optional) + - parameter useDomainPool: (query) (optional) + - parameter expiresAt: (query) (optional) + - parameter expiresIn: (query) (optional) + - parameter emailAddress: (query) (optional) + - parameter inboxType: (query) (optional) + - parameter _description: (query) (optional) + - parameter name: (query) (optional) + - parameter tags: (query) (optional) + - parameter favourite: (query) (optional) + - parameter virtualInbox: (query) (optional) + - returns: RequestBuilder + */ + open class func createNewEmailAddressWithRequestBuilder(allowTeamAccess: Bool? = nil, useDomainPool: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, emailAddress: String? = nil, inboxType: InboxType_createNewEmailAddress? = nil, _description: String? = nil, name: String? = nil, tags: [String]? = nil, favourite: Bool? = nil, virtualInbox: Bool? = nil) -> RequestBuilder { + let path = "/newEmailAddress" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "allowTeamAccess": allowTeamAccess?.encodeToJSON(), + "useDomainPool": useDomainPool?.encodeToJSON(), + "expiresAt": expiresAt?.encodeToJSON(), + "expiresIn": expiresIn?.encodeToJSON(), + "emailAddress": emailAddress?.encodeToJSON(), + "inboxType": inboxType?.encodeToJSON(), + "description": _description?.encodeToJSON(), + "name": name?.encodeToJSON(), + "tags": tags?.encodeToJSON(), + "favourite": favourite?.encodeToJSON(), + "virtualInbox": virtualInbox?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter inboxType + */ + public enum InboxType_createRandomInbox: String, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + + /** + Create new random inbox + + - parameter allowTeamAccess: (query) (optional) + - parameter useDomainPool: (query) (optional) + - parameter expiresAt: (query) (optional) + - parameter expiresIn: (query) (optional) + - parameter emailAddress: (query) (optional) + - parameter inboxType: (query) (optional) + - parameter _description: (query) (optional) + - parameter name: (query) (optional) + - parameter tags: (query) (optional) + - parameter favourite: (query) (optional) + - parameter virtualInbox: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createRandomInbox( allowTeamAccess: Bool? = nil, useDomainPool: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, emailAddress: String? = nil, inboxType: InboxType_createRandomInbox? = nil, _description: String? = nil, name: String? = nil, tags: [String]? = nil, favourite: Bool? = nil, virtualInbox: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createRandomInboxWithRequestBuilder(allowTeamAccess: allowTeamAccess, useDomainPool: useDomainPool, expiresAt: expiresAt, expiresIn: expiresIn, emailAddress: emailAddress, inboxType: inboxType, _description: _description, name: name, tags: tags, favourite: favourite, virtualInbox: virtualInbox).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create new random inbox + - POST /createInbox + - Returns an Inbox with an `id` and an `emailAddress` + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter allowTeamAccess: (query) (optional) + - parameter useDomainPool: (query) (optional) + - parameter expiresAt: (query) (optional) + - parameter expiresIn: (query) (optional) + - parameter emailAddress: (query) (optional) + - parameter inboxType: (query) (optional) + - parameter _description: (query) (optional) + - parameter name: (query) (optional) + - parameter tags: (query) (optional) + - parameter favourite: (query) (optional) + - parameter virtualInbox: (query) (optional) + - returns: RequestBuilder + */ + open class func createRandomInboxWithRequestBuilder(allowTeamAccess: Bool? = nil, useDomainPool: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, emailAddress: String? = nil, inboxType: InboxType_createRandomInbox? = nil, _description: String? = nil, name: String? = nil, tags: [String]? = nil, favourite: Bool? = nil, virtualInbox: Bool? = nil) -> RequestBuilder { + let path = "/createInbox" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "allowTeamAccess": allowTeamAccess?.encodeToJSON(), + "useDomainPool": useDomainPool?.encodeToJSON(), + "expiresAt": expiresAt?.encodeToJSON(), + "expiresIn": expiresIn?.encodeToJSON(), + "emailAddress": emailAddress?.encodeToJSON(), + "inboxType": inboxType?.encodeToJSON(), + "description": _description?.encodeToJSON(), + "name": name?.encodeToJSON(), + "tags": tags?.encodeToJSON(), + "favourite": favourite?.encodeToJSON(), + "virtualInbox": virtualInbox?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete inbox email address by inbox id + + - parameter inboxId: (query) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteEmailAddress( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteEmailAddressWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete inbox email address by inbox id + - DELETE /deleteEmailAddress + - Deletes inbox email address + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) + - returns: RequestBuilder + */ + open class func deleteEmailAddressWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + let path = "/deleteEmailAddress" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete all emails in an inbox + + - parameter inboxId: (query) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func emptyInbox( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + emptyInboxWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all emails in an inbox + - DELETE /emptyInbox + - Deletes all emails + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) + - returns: RequestBuilder + */ + open class func emptyInboxWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + let path = "/emptyInbox" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send an email + + - parameter simpleSendEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendEmailSimple( simpleSendEmailOptions: SimpleSendEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendEmailSimpleWithRequestBuilder(simpleSendEmailOptions: simpleSendEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send an email + - POST /sendEmail + - If no senderId or inboxId provided a random email address will be used to send from. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter simpleSendEmailOptions: (body) + - returns: RequestBuilder + */ + open class func sendEmailSimpleWithRequestBuilder(simpleSendEmailOptions: SimpleSendEmailOptions) -> RequestBuilder { + let path = "/sendEmail" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: simpleSendEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/ContactControllerAPI.swift b/mailslurp/APIs/ContactControllerAPI.swift new file mode 100644 index 00000000..02acd4a2 --- /dev/null +++ b/mailslurp/APIs/ContactControllerAPI.swift @@ -0,0 +1,324 @@ +// +// ContactControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class ContactControllerAPI : NSObject { + /** + Create a contact + + - parameter createContactOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createContact( createContactOptions: CreateContactOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createContactWithRequestBuilder(createContactOptions: createContactOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create a contact + - POST /contacts + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createContactOptions: (body) + - returns: RequestBuilder + */ + open class func createContactWithRequestBuilder(createContactOptions: CreateContactOptions) -> RequestBuilder { + let path = "/contacts" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createContactOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete contact + + - parameter contactId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteContact( contactId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteContactWithRequestBuilder(contactId: contactId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete contact + - DELETE /contacts/{contactId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter contactId: (path) + - returns: RequestBuilder + */ + open class func deleteContactWithRequestBuilder(contactId: UUID) -> RequestBuilder { + var path = "/contacts/{contactId}" + let contactIdPreEscape = "\(APIHelper.mapValueToPathItem(contactId))" + let contactIdPostEscape = contactIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{contactId}", with: contactIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllContacts: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all contacts + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllContacts( page: Int? = nil, size: Int? = nil, sort: Sort_getAllContacts? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllContactsWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all contacts + - GET /contacts/paginated + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAllContactsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllContacts? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/contacts/paginated" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get contact + + - parameter contactId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getContact( contactId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getContactWithRequestBuilder(contactId: contactId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get contact + - GET /contacts/{contactId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter contactId: (path) + - returns: RequestBuilder + */ + open class func getContactWithRequestBuilder(contactId: UUID) -> RequestBuilder { + var path = "/contacts/{contactId}" + let contactIdPreEscape = "\(APIHelper.mapValueToPathItem(contactId))" + let contactIdPostEscape = contactIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{contactId}", with: contactIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get contact vCard vcf file + + - parameter contactId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[Data]> + */ + open class func getContactVCard( contactId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[Data]> { + let deferred = Promise<[Data]>.pending() + getContactVCardWithRequestBuilder(contactId: contactId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get contact vCard vcf file + - GET /contacts/{contactId}/download + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter contactId: (path) + - returns: RequestBuilder<[Data]> + */ + open class func getContactVCardWithRequestBuilder(contactId: UUID) -> RequestBuilder<[Data]> { + var path = "/contacts/{contactId}/download" + let contactIdPreEscape = "\(APIHelper.mapValueToPathItem(contactId))" + let contactIdPostEscape = contactIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{contactId}", with: contactIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[Data]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get all contacts + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[ContactProjection]> + */ + open class func getContacts(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[ContactProjection]> { + let deferred = Promise<[ContactProjection]>.pending() + getContactsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all contacts + - GET /contacts + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[ContactProjection]> + */ + open class func getContactsWithRequestBuilder() -> RequestBuilder<[ContactProjection]> { + let path = "/contacts" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[ContactProjection]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/DomainControllerAPI.swift b/mailslurp/APIs/DomainControllerAPI.swift new file mode 100644 index 00000000..c165cf29 --- /dev/null +++ b/mailslurp/APIs/DomainControllerAPI.swift @@ -0,0 +1,312 @@ +// +// DomainControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class DomainControllerAPI : NSObject { + /** + Add catch all wild card inbox to domain + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func addDomainWildcardCatchAll( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + addDomainWildcardCatchAllWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Add catch all wild card inbox to domain + - POST /domains/{id}/wildcard + - Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func addDomainWildcardCatchAllWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/domains/{id}/wildcard" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Create Domain + + - parameter createDomainOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createDomain( createDomainOptions: CreateDomainOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createDomainWithRequestBuilder(createDomainOptions: createDomainOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create Domain + - POST /domains + - Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createDomainOptions: (body) + - returns: RequestBuilder + */ + open class func createDomainWithRequestBuilder(createDomainOptions: CreateDomainOptions) -> RequestBuilder { + let path = "/domains" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createDomainOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete a domain + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[String]> + */ + open class func deleteDomain( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[String]> { + let deferred = Promise<[String]>.pending() + deleteDomainWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete a domain + - DELETE /domains/{id} + - Delete a domain. This will disable any existing inboxes that use this domain. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder<[String]> + */ + open class func deleteDomainWithRequestBuilder(_id: UUID) -> RequestBuilder<[String]> { + var path = "/domains/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[String]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get a domain + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getDomain( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getDomainWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a domain + - GET /domains/{id} + - Returns domain verification status and tokens for a given domain + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func getDomainWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/domains/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get domains + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[DomainPreview]> + */ + open class func getDomains(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[DomainPreview]> { + let deferred = Promise<[DomainPreview]>.pending() + getDomainsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get domains + - GET /domains + - List all custom domains you have created + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[DomainPreview]> + */ + open class func getDomainsWithRequestBuilder() -> RequestBuilder<[DomainPreview]> { + let path = "/domains" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[DomainPreview]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Update a domain + + - parameter _id: (path) + - parameter updateDomainOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func updateDomain( _id: UUID, updateDomainOptions: UpdateDomainOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + updateDomainWithRequestBuilder(_id: _id, updateDomainOptions: updateDomainOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Update a domain + - PUT /domains/{id} + - Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - parameter updateDomainOptions: (body) + - returns: RequestBuilder + */ + open class func updateDomainWithRequestBuilder(_id: UUID, updateDomainOptions: UpdateDomainOptions) -> RequestBuilder { + var path = "/domains/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateDomainOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/EmailControllerAPI.swift b/mailslurp/APIs/EmailControllerAPI.swift new file mode 100644 index 00000000..8f9c91fc --- /dev/null +++ b/mailslurp/APIs/EmailControllerAPI.swift @@ -0,0 +1,1707 @@ +// +// EmailControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class EmailControllerAPI : NSObject { + /** + Set IMAP flags associated with a message. Only supports '\\Seen' flag. + + - parameter emailId: (path) + - parameter imapFlagOperationOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func applyImapFlagOperation( emailId: UUID, imapFlagOperationOptions: ImapFlagOperationOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + applyImapFlagOperationWithRequestBuilder(emailId: emailId, imapFlagOperationOptions: imapFlagOperationOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Set IMAP flags associated with a message. Only supports '\\Seen' flag. + - POST /emails/{emailId}/imap-flag-operation + - Apply RFC3501 section-2.3.2 IMAP flag operations on an email + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) + - parameter imapFlagOperationOptions: (body) + - returns: RequestBuilder + */ + open class func applyImapFlagOperationWithRequestBuilder(emailId: UUID, imapFlagOperationOptions: ImapFlagOperationOptions) -> RequestBuilder { + var path = "/emails/{emailId}/imap-flag-operation" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: imapFlagOperationOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete all emails in all inboxes. + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAllEmails(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAllEmailsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all emails in all inboxes. + - DELETE /emails + - Deletes all emails in your account. Be careful as emails cannot be recovered + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func deleteAllEmailsWithRequestBuilder() -> RequestBuilder { + let path = "/emails" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete an email + + - parameter emailId: (path) ID of email to delete + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteEmail( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteEmailWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete an email + - DELETE /emails/{emailId} + - Deletes an email and removes it from the inbox. Deleted emails cannot be recovered. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email to delete + - returns: RequestBuilder + */ + open class func deleteEmailWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. + + - parameter emailId: (path) ID of email + - parameter attachmentId: (path) ID of attachment + - parameter apiKey: (query) Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func downloadAttachment( emailId: UUID, attachmentId: String, apiKey: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + downloadAttachmentWithRequestBuilder(emailId: emailId, attachmentId: attachmentId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. + - GET /emails/{emailId}/attachments/{attachmentId} + - Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - parameter attachmentId: (path) ID of attachment + - parameter apiKey: (query) Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional) + - returns: RequestBuilder + */ + open class func downloadAttachmentWithRequestBuilder(emailId: UUID, attachmentId: String, apiKey: String? = nil) -> RequestBuilder { + var path = "/emails/{emailId}/attachments/{attachmentId}" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "apiKey": apiKey?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. + + - parameter emailId: (path) ID of email + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func downloadAttachmentBase64( emailId: UUID, attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + downloadAttachmentBase64WithRequestBuilder(emailId: emailId, attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. + - GET /emails/{emailId}/attachments/{attachmentId}/base64 + - Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func downloadAttachmentBase64WithRequestBuilder(emailId: UUID, attachmentId: String) -> RequestBuilder { + var path = "/emails/{emailId}/attachments/{attachmentId}/base64" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email body as string. Returned as `plain/text` with content type header. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func downloadBody( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + downloadBodyWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email body as string. Returned as `plain/text` with content type header. + - GET /emails/{emailId}/body + - Returns the specified email body for a given email as a string + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func downloadBodyWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/body" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email body in bytes. Returned as `octet-stream` with content type header. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func downloadBodyBytes( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + downloadBodyBytesWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email body in bytes. Returned as `octet-stream` with content type header. + - GET /emails/{emailId}/body-bytes + - Returns the specified email body for a given email as a stream / array of bytes. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func downloadBodyBytesWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/body-bytes" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Forward email to recipients + + - parameter emailId: (path) ID of email + - parameter forwardEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func forwardEmail( emailId: UUID, forwardEmailOptions: ForwardEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + forwardEmailWithRequestBuilder(emailId: emailId, forwardEmailOptions: forwardEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Forward email to recipients + - POST /emails/{emailId}/forward + - Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the `from` option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - parameter forwardEmailOptions: (body) + - returns: RequestBuilder + */ + open class func forwardEmailWithRequestBuilder(emailId: UUID, forwardEmailOptions: ForwardEmailOptions) -> RequestBuilder { + var path = "/emails/{emailId}/forward" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: forwardEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. + + - parameter emailId: (path) ID of email + - parameter attachmentId: (path) ID of attachment + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAttachmentMetaData( emailId: UUID, attachmentId: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAttachmentMetaDataWithRequestBuilder(emailId: emailId, attachmentId: attachmentId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. + - GET /emails/{emailId}/attachments/{attachmentId}/metadata + - Returns the metadata such as name and content-type for a given attachment and email. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - parameter attachmentId: (path) ID of attachment + - returns: RequestBuilder + */ + open class func getAttachmentMetaDataWithRequestBuilder(emailId: UUID, attachmentId: String) -> RequestBuilder { + var path = "/emails/{emailId}/attachments/{attachmentId}/metadata" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let attachmentIdPreEscape = "\(APIHelper.mapValueToPathItem(attachmentId))" + let attachmentIdPostEscape = attachmentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{attachmentId}", with: attachmentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController. + + - parameter emailId: (path) + - parameter decode: (query) Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional, default to false) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmail( emailId: UUID, decode: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailWithRequestBuilder(emailId: emailId, decode: decode).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController. + - GET /emails/{emailId} + - Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) + - parameter decode: (query) Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional, default to false) + - returns: RequestBuilder + */ + open class func getEmailWithRequestBuilder(emailId: UUID, decode: Bool? = nil) -> RequestBuilder { + var path = "/emails/{emailId}" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "decode": decode?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get all email attachment metadata. Metadata includes name and size of attachments. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[AttachmentMetaData]> + */ + open class func getEmailAttachments( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[AttachmentMetaData]> { + let deferred = Promise<[AttachmentMetaData]>.pending() + getEmailAttachmentsWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all email attachment metadata. Metadata includes name and size of attachments. + - GET /emails/{emailId}/attachments + - Returns an array of attachment metadata such as name and content-type for a given email if present. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder<[AttachmentMetaData]> + */ + open class func getEmailAttachmentsWithRequestBuilder(emailId: UUID) -> RequestBuilder<[AttachmentMetaData]> { + var path = "/emails/{emailId}/attachments" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[AttachmentMetaData]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email content regex pattern match results. Runs regex against email body and returns match groups. + + - parameter emailId: (path) ID of email to match against + - parameter contentMatchOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailContentMatch( emailId: UUID, contentMatchOptions: ContentMatchOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailContentMatchWithRequestBuilder(emailId: emailId, contentMatchOptions: contentMatchOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email content regex pattern match results. Runs regex against email body and returns match groups. + - POST /emails/{emailId}/contentMatch + - Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email to match against + - parameter contentMatchOptions: (body) + - returns: RequestBuilder + */ + open class func getEmailContentMatchWithRequestBuilder(emailId: UUID, contentMatchOptions: ContentMatchOptions) -> RequestBuilder { + var path = "/emails/{emailId}/contentMatch" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: contentMatchOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email count + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailCount(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailCountWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email count + - GET /emails/emails/count + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getEmailCountWithRequestBuilder() -> RequestBuilder { + let path = "/emails/emails/count" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email content as HTML. For displaying emails in browser context. + + - parameter emailId: (path) + - parameter decode: (query) (optional, default to false) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailHTML( emailId: UUID, decode: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailHTMLWithRequestBuilder(emailId: emailId, decode: decode).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email content as HTML. For displaying emails in browser context. + - GET /emails/{emailId}/html + - Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`. Returns content-type `text/html;charset=utf-8` so you must call expecting that content response not JSON. For JSON response see the `getEmailHTMLJson` method. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) + - parameter decode: (query) (optional, default to false) + - returns: RequestBuilder + */ + open class func getEmailHTMLWithRequestBuilder(emailId: UUID, decode: Bool? = nil) -> RequestBuilder { + var path = "/emails/{emailId}/html" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "decode": decode?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content + + - parameter emailId: (path) + - parameter decode: (query) (optional, default to false) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailHTMLJson( emailId: UUID, decode: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailHTMLJsonWithRequestBuilder(emailId: emailId, decode: decode).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content + - GET /emails/{emailId}/html/json + - Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type `application/json;charset=utf-8` so you must call expecting that content response not JSON. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) + - parameter decode: (query) (optional, default to false) + - returns: RequestBuilder + */ + open class func getEmailHTMLJsonWithRequestBuilder(emailId: UUID, decode: Bool? = nil) -> RequestBuilder { + var path = "/emails/{emailId}/html/json" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "decode": decode?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Parse and return text from an email, stripping HTML and decoding encoded characters + + - parameter emailId: (path) ID of email to perform HTML query on + - parameter htmlSelector: (query) HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailHTMLQuery( emailId: UUID, htmlSelector: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailHTMLQueryWithRequestBuilder(emailId: emailId, htmlSelector: htmlSelector).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Parse and return text from an email, stripping HTML and decoding encoded characters + - GET /emails/{emailId}/htmlQuery + - Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email to perform HTML query on + - parameter htmlSelector: (query) HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. + - returns: RequestBuilder + */ + open class func getEmailHTMLQueryWithRequestBuilder(emailId: UUID, htmlSelector: String) -> RequestBuilder { + var path = "/emails/{emailId}/htmlQuery" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "htmlSelector": htmlSelector.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Parse and return list of links found in an email (only works for HTML content) + + - parameter emailId: (path) ID of email to fetch text for + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailLinks( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailLinksWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Parse and return list of links found in an email (only works for HTML content) + - GET /emails/{emailId}/links + - HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email to fetch text for + - returns: RequestBuilder + */ + open class func getEmailLinksWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/links" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email URLs for viewing in browser or downloading + + - parameter emailId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailPreviewURLs( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailPreviewURLsWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email URLs for viewing in browser or downloading + - GET /emails/{emailId}/urls + - Get a list of URLs for email content as text/html or raw SMTP message for viewing the message in a browser. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) + - returns: RequestBuilder + */ + open class func getEmailPreviewURLsWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/urls" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Parse and return text from an email, stripping HTML and decoding encoded characters + + - parameter emailId: (path) ID of email to fetch text for + - parameter decodeHtmlEntities: (query) Decode HTML entities (optional) + - parameter lineSeparator: (query) Line separator character (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailTextLines( emailId: UUID, decodeHtmlEntities: Bool? = nil, lineSeparator: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailTextLinesWithRequestBuilder(emailId: emailId, decodeHtmlEntities: decodeHtmlEntities, lineSeparator: lineSeparator).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Parse and return text from an email, stripping HTML and decoding encoded characters + - GET /emails/{emailId}/textLines + - Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email to fetch text for + - parameter decodeHtmlEntities: (query) Decode HTML entities (optional) + - parameter lineSeparator: (query) Line separator character (optional) + - returns: RequestBuilder + */ + open class func getEmailTextLinesWithRequestBuilder(emailId: UUID, decodeHtmlEntities: Bool? = nil, lineSeparator: String? = nil) -> RequestBuilder { + var path = "/emails/{emailId}/textLines" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "decodeHtmlEntities": decodeHtmlEntities?.encodeToJSON(), + "lineSeparator": lineSeparator?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getEmailsPaginated: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all emails in all inboxes in paginated form. Email API list all. + + - parameter inboxId: (query) Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional) + - parameter page: (query) Optional page index in email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter unreadOnly: (query) Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false) + - parameter searchFilter: (query) Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional) + - parameter since: (query) Optional filter emails received after given date time (optional) + - parameter before: (query) Optional filter emails received before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmailsPaginated( inboxId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getEmailsPaginated? = nil, unreadOnly: Bool? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmailsPaginatedWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, unreadOnly: unreadOnly, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all emails in all inboxes in paginated form. Email API list all. + - GET /emails + - By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional) + - parameter page: (query) Optional page index in email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter unreadOnly: (query) Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false) + - parameter searchFilter: (query) Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional) + - parameter since: (query) Optional filter emails received after given date time (optional) + - parameter before: (query) Optional filter emails received before given date time (optional) + - returns: RequestBuilder + */ + open class func getEmailsPaginatedWithRequestBuilder(inboxId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getEmailsPaginated? = nil, unreadOnly: Bool? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/emails" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter emailAddress: (query) + - parameter size: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getGravatarUrlForEmailAddress( emailAddress: String, size: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getGravatarUrlForEmailAddressWithRequestBuilder(emailAddress: emailAddress, size: size).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /emails/gravatarFor + - Get gravatar url for email address + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailAddress: (query) + - parameter size: (query) (optional) + - returns: RequestBuilder + */ + open class func getGravatarUrlForEmailAddressWithRequestBuilder(emailAddress: String, size: String? = nil) -> RequestBuilder { + let path = "/emails/gravatarFor" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "emailAddress": emailAddress.encodeToJSON(), + "size": size?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get latest email in all inboxes. Most recently received. + + - parameter inboxIds: (query) Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getLatestEmail( inboxIds: [UUID]? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getLatestEmailWithRequestBuilder(inboxIds: inboxIds).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get latest email in all inboxes. Most recently received. + - GET /emails/latest + - Get the newest email in all inboxes or in a passed set of inbox IDs + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxIds: (query) Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional) + - returns: RequestBuilder + */ + open class func getLatestEmailWithRequestBuilder(inboxIds: [UUID]? = nil) -> RequestBuilder { + let path = "/emails/latest" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxIds": inboxIds?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. + + - parameter inboxId: (query) ID of the inbox you want to get the latest email from + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getLatestEmailInInbox1( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getLatestEmailInInbox1WithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. + - GET /emails/latestIn + - Get the newest email in all inboxes or in a passed set of inbox IDs + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) ID of the inbox you want to get the latest email from + - returns: RequestBuilder + */ + open class func getLatestEmailInInbox1WithRequestBuilder(inboxId: UUID) -> RequestBuilder { + let path = "/emails/latestIn" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getOrganizationEmailsPaginated: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all organization emails. List team or shared test email accounts + + - parameter inboxId: (query) Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional) + - parameter page: (query) Optional page index in email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter unreadOnly: (query) Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false) + - parameter searchFilter: (query) Optional search filter search filter for emails. (optional) + - parameter since: (query) Optional filter emails received after given date time (optional) + - parameter before: (query) Optional filter emails received before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getOrganizationEmailsPaginated( inboxId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getOrganizationEmailsPaginated? = nil, unreadOnly: Bool? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getOrganizationEmailsPaginatedWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, unreadOnly: unreadOnly, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all organization emails. List team or shared test email accounts + - GET /emails/organization + - By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional) + - parameter page: (query) Optional page index in email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter unreadOnly: (query) Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false) + - parameter searchFilter: (query) Optional search filter search filter for emails. (optional) + - parameter since: (query) Optional filter emails received after given date time (optional) + - parameter before: (query) Optional filter emails received before given date time (optional) + - returns: RequestBuilder + */ + open class func getOrganizationEmailsPaginatedWithRequestBuilder(inboxId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getOrganizationEmailsPaginated? = nil, unreadOnly: Bool? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/emails/organization" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get raw email string. Returns unparsed raw SMTP message with headers and body. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getRawEmailContents( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getRawEmailContentsWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get raw email string. Returns unparsed raw SMTP message with headers and body. + - GET /emails/{emailId}/raw + - Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func getRawEmailContentsWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/raw" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getRawEmailJson( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getRawEmailJsonWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. + - GET /emails/{emailId}/raw/json + - Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func getRawEmailJsonWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/raw/json" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get unread email count + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getUnreadEmailCount(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getUnreadEmailCountWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get unread email count + - GET /emails/unreadCount + - Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getUnreadEmailCountWithRequestBuilder() -> RequestBuilder { + let path = "/emails/unreadCount" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Mark an email as read on unread + + - parameter emailId: (path) + - parameter read: (query) What value to assign to email read property. Default true. (optional, default to true) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func markAsRead( emailId: UUID, read: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + markAsReadWithRequestBuilder(emailId: emailId, read: read).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Mark an email as read on unread + - PATCH /emails/{emailId}/read + - Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) + - parameter read: (query) What value to assign to email read property. Default true. (optional, default to true) + - returns: RequestBuilder + */ + open class func markAsReadWithRequestBuilder(emailId: UUID, read: Bool? = nil) -> RequestBuilder { + var path = "/emails/{emailId}/read" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "read": read?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Reply to an email + + - parameter emailId: (path) ID of the email that should be replied to + - parameter replyToEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func replyToEmail( emailId: UUID, replyToEmailOptions: ReplyToEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + replyToEmailWithRequestBuilder(emailId: emailId, replyToEmailOptions: replyToEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Reply to an email + - PUT /emails/{emailId} + - Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of the email that should be replied to + - parameter replyToEmailOptions: (body) + - returns: RequestBuilder + */ + open class func replyToEmailWithRequestBuilder(emailId: UUID, replyToEmailOptions: ReplyToEmailOptions) -> RequestBuilder { + var path = "/emails/{emailId}" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: replyToEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send email + + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendEmailOptions: (body) + - parameter useDomainPool: (query) Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional) + - parameter virtualSend: (query) Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendEmailSourceOptional( inboxId: UUID, sendEmailOptions: SendEmailOptions, useDomainPool: Bool? = nil, virtualSend: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendEmailSourceOptionalWithRequestBuilder(inboxId: inboxId, sendEmailOptions: sendEmailOptions, useDomainPool: useDomainPool, virtualSend: virtualSend).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send email + - POST /emails + - Alias for `InboxController.sendEmail` method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendEmailOptions: (body) + - parameter useDomainPool: (query) Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional) + - parameter virtualSend: (query) Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional) + - returns: RequestBuilder + */ + open class func sendEmailSourceOptionalWithRequestBuilder(inboxId: UUID, sendEmailOptions: SendEmailOptions, useDomainPool: Bool? = nil, virtualSend: Bool? = nil) -> RequestBuilder { + var path = "/emails" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: sendEmailOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "useDomainPool": useDomainPool?.encodeToJSON(), + "virtualSend": virtualSend?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Validate email HTML contents + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func validateEmail( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + validateEmailWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Validate email HTML contents + - POST /emails/{emailId}/validate + - Validate the HTML content of email if HTML is found. Considered valid if no HTML is present. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func validateEmailWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/emails/{emailId}/validate" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/EmailVerificationControllerAPI.swift b/mailslurp/APIs/EmailVerificationControllerAPI.swift new file mode 100644 index 00000000..deb6e6fa --- /dev/null +++ b/mailslurp/APIs/EmailVerificationControllerAPI.swift @@ -0,0 +1,135 @@ +// +// EmailVerificationControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class EmailVerificationControllerAPI : NSObject { + /** + * enum for parameter sort + */ + public enum Sort_getValidationRequests: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Validate a list of email addresses. Per unit billing. See your plan for pricing. + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size for paginated result list. (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .desc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter isValid: (query) Filter where email is valid is true or false (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getValidationRequests( page: Int? = nil, size: Int? = nil, sort: Sort_getValidationRequests? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, isValid: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getValidationRequestsWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, isValid: isValid).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Validate a list of email addresses. Per unit billing. See your plan for pricing. + - GET /email-verification/validation-requests + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size for paginated result list. (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .desc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter isValid: (query) Filter where email is valid is true or false (optional) + - returns: RequestBuilder + */ + open class func getValidationRequestsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getValidationRequests? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, isValid: Bool? = nil) -> RequestBuilder { + let path = "/email-verification/validation-requests" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "isValid": isValid?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Validate a list of email addresses. Per unit billing. See your plan for pricing. + + - parameter validateEmailAddressListOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func validateEmailAddressList( validateEmailAddressListOptions: ValidateEmailAddressListOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + validateEmailAddressListWithRequestBuilder(validateEmailAddressListOptions: validateEmailAddressListOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Validate a list of email addresses. Per unit billing. See your plan for pricing. + - POST /email-verification/email-address-list + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter validateEmailAddressListOptions: (body) + - returns: RequestBuilder + */ + open class func validateEmailAddressListWithRequestBuilder(validateEmailAddressListOptions: ValidateEmailAddressListOptions) -> RequestBuilder { + let path = "/email-verification/email-address-list" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: validateEmailAddressListOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/ExpiredControllerAPI.swift b/mailslurp/APIs/ExpiredControllerAPI.swift new file mode 100644 index 00000000..930e6f1a --- /dev/null +++ b/mailslurp/APIs/ExpiredControllerAPI.swift @@ -0,0 +1,231 @@ +// +// ExpiredControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class ExpiredControllerAPI : NSObject { + /** + Get default expiration settings + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getExpirationDefaults(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getExpirationDefaultsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get default expiration settings + - GET /expired/defaults + - Return default times used for inbox expiration + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getExpirationDefaultsWithRequestBuilder() -> RequestBuilder { + let path = "/expired/defaults" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get expired inbox record for a previously existing inbox + + - parameter inboxId: (path) ID of inbox you want to retrieve (not the inbox ID) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getExpiredInboxByInboxId( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getExpiredInboxByInboxIdWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get expired inbox record for a previously existing inbox + - GET /expired/inbox/{inboxId} + - Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of inbox you want to retrieve (not the inbox ID) + - returns: RequestBuilder + */ + open class func getExpiredInboxByInboxIdWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + var path = "/expired/inbox/{inboxId}" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get an expired inbox record + + - parameter expiredId: (path) ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getExpiredInboxRecord( expiredId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getExpiredInboxRecordWithRequestBuilder(expiredId: expiredId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get an expired inbox record + - GET /expired/{expiredId} + - Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter expiredId: (path) ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId + - returns: RequestBuilder + */ + open class func getExpiredInboxRecordWithRequestBuilder(expiredId: UUID) -> RequestBuilder { + var path = "/expired/{expiredId}" + let expiredIdPreEscape = "\(APIHelper.mapValueToPathItem(expiredId))" + let expiredIdPostEscape = expiredIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{expiredId}", with: expiredIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getExpiredInboxes: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List records of expired inboxes + + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getExpiredInboxes( page: Int? = nil, size: Int? = nil, sort: Sort_getExpiredInboxes? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getExpiredInboxesWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List records of expired inboxes + - GET /expired + - Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getExpiredInboxesWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getExpiredInboxes? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/expired" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/ExportControllerAPI.swift b/mailslurp/APIs/ExportControllerAPI.swift new file mode 100644 index 00000000..98ac77e7 --- /dev/null +++ b/mailslurp/APIs/ExportControllerAPI.swift @@ -0,0 +1,166 @@ +// +// ExportControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class ExportControllerAPI : NSObject { + /** + * enum for parameter exportType + */ + public enum ExportType_exportEntities: String, CaseIterable { + case inboxes = "INBOXES" + case contacts = "CONTACTS" + case attachments = "ATTACHMENTS" + case emails = "EMAILS" + } + + /** + * enum for parameter outputFormat + */ + public enum OutputFormat_exportEntities: String, CaseIterable { + case _default = "CSV_DEFAULT" + case excel = "CSV_EXCEL" + } + + /** + Export inboxes link callable via browser + + - parameter exportType: (query) + - parameter apiKey: (query) + - parameter outputFormat: (query) + - parameter filter: (query) (optional) + - parameter listSeparatorToken: (query) (optional) + - parameter excludePreviouslyExported: (query) (optional) + - parameter createdEarliestTime: (query) (optional) + - parameter createdOldestTime: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[Data]> + */ + open class func exportEntities( exportType: ExportType_exportEntities, apiKey: String, outputFormat: OutputFormat_exportEntities, filter: String? = nil, listSeparatorToken: String? = nil, excludePreviouslyExported: Bool? = nil, createdEarliestTime: Date? = nil, createdOldestTime: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[Data]> { + let deferred = Promise<[Data]>.pending() + exportEntitiesWithRequestBuilder(exportType: exportType, apiKey: apiKey, outputFormat: outputFormat, filter: filter, listSeparatorToken: listSeparatorToken, excludePreviouslyExported: excludePreviouslyExported, createdEarliestTime: createdEarliestTime, createdOldestTime: createdOldestTime).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Export inboxes link callable via browser + - GET /export + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter exportType: (query) + - parameter apiKey: (query) + - parameter outputFormat: (query) + - parameter filter: (query) (optional) + - parameter listSeparatorToken: (query) (optional) + - parameter excludePreviouslyExported: (query) (optional) + - parameter createdEarliestTime: (query) (optional) + - parameter createdOldestTime: (query) (optional) + - returns: RequestBuilder<[Data]> + */ + open class func exportEntitiesWithRequestBuilder(exportType: ExportType_exportEntities, apiKey: String, outputFormat: OutputFormat_exportEntities, filter: String? = nil, listSeparatorToken: String? = nil, excludePreviouslyExported: Bool? = nil, createdEarliestTime: Date? = nil, createdOldestTime: Date? = nil) -> RequestBuilder<[Data]> { + let path = "/export" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "exportType": exportType.encodeToJSON(), + "apiKey": apiKey.encodeToJSON(), + "outputFormat": outputFormat.encodeToJSON(), + "filter": filter?.encodeToJSON(), + "listSeparatorToken": listSeparatorToken?.encodeToJSON(), + "excludePreviouslyExported": excludePreviouslyExported?.encodeToJSON(), + "createdEarliestTime": createdEarliestTime?.encodeToJSON(), + "createdOldestTime": createdOldestTime?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[Data]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter exportType + */ + public enum ExportType_getExportLink: String, CaseIterable { + case inboxes = "INBOXES" + case contacts = "CONTACTS" + case attachments = "ATTACHMENTS" + case emails = "EMAILS" + } + + /** + Get export link + + - parameter exportType: (query) + - parameter exportOptions: (body) + - parameter apiKey: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getExportLink( exportType: ExportType_getExportLink, exportOptions: ExportOptions, apiKey: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getExportLinkWithRequestBuilder(exportType: exportType, exportOptions: exportOptions, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get export link + - POST /export + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter exportType: (query) + - parameter exportOptions: (body) + - parameter apiKey: (query) (optional) + - returns: RequestBuilder + */ + open class func getExportLinkWithRequestBuilder(exportType: ExportType_getExportLink, exportOptions: ExportOptions, apiKey: String? = nil) -> RequestBuilder { + let path = "/export" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: exportOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "exportType": exportType.encodeToJSON(), + "apiKey": apiKey?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/FormControllerAPI.swift b/mailslurp/APIs/FormControllerAPI.swift new file mode 100644 index 00000000..6a958ee5 --- /dev/null +++ b/mailslurp/APIs/FormControllerAPI.swift @@ -0,0 +1,81 @@ +// +// FormControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class FormControllerAPI : NSObject { + /** + Submit a form to be parsed and sent as an email to an address determined by the form fields + + - parameter to: (query) The email address that submitted form should be sent to. (optional) + - parameter subject: (query) Optional subject of the email that will be sent. (optional) + - parameter redirectTo: (query) Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) + - parameter emailAddress: (query) Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) + - parameter successMessage: (query) Optional success message to display if no _redirectTo present. (optional) + - parameter spamCheck: (query) Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) + - parameter otherParameters: (query) All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func submitForm( to: String? = nil, subject: String? = nil, redirectTo: String? = nil, emailAddress: String? = nil, successMessage: String? = nil, spamCheck: String? = nil, otherParameters: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + submitFormWithRequestBuilder(to: to, subject: subject, redirectTo: redirectTo, emailAddress: emailAddress, successMessage: successMessage, spamCheck: spamCheck, otherParameters: otherParameters).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Submit a form to be parsed and sent as an email to an address determined by the form fields + - POST /forms + - This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html ``` #### URL Example ```html
``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `
`. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter to: (query) The email address that submitted form should be sent to. (optional) + - parameter subject: (query) Optional subject of the email that will be sent. (optional) + - parameter redirectTo: (query) Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) + - parameter emailAddress: (query) Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) + - parameter successMessage: (query) Optional success message to display if no _redirectTo present. (optional) + - parameter spamCheck: (query) Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) + - parameter otherParameters: (query) All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) + - returns: RequestBuilder + */ + open class func submitFormWithRequestBuilder(to: String? = nil, subject: String? = nil, redirectTo: String? = nil, emailAddress: String? = nil, successMessage: String? = nil, spamCheck: String? = nil, otherParameters: String? = nil) -> RequestBuilder { + let path = "/forms" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "_to": to?.encodeToJSON(), + "_subject": subject?.encodeToJSON(), + "_redirectTo": redirectTo?.encodeToJSON(), + "_emailAddress": emailAddress?.encodeToJSON(), + "_successMessage": successMessage?.encodeToJSON(), + "_spamCheck": spamCheck?.encodeToJSON(), + "otherParameters": otherParameters?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/GroupControllerAPI.swift b/mailslurp/APIs/GroupControllerAPI.swift new file mode 100644 index 00000000..80726eaa --- /dev/null +++ b/mailslurp/APIs/GroupControllerAPI.swift @@ -0,0 +1,502 @@ +// +// GroupControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class GroupControllerAPI : NSObject { + /** + Add contacts to a group + + - parameter groupId: (path) + - parameter updateGroupContacts: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func addContactsToGroup( groupId: UUID, updateGroupContacts: UpdateGroupContacts, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + addContactsToGroupWithRequestBuilder(groupId: groupId, updateGroupContacts: updateGroupContacts).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Add contacts to a group + - PUT /groups/{groupId}/contacts + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter groupId: (path) + - parameter updateGroupContacts: (body) + - returns: RequestBuilder + */ + open class func addContactsToGroupWithRequestBuilder(groupId: UUID, updateGroupContacts: UpdateGroupContacts) -> RequestBuilder { + var path = "/groups/{groupId}/contacts" + let groupIdPreEscape = "\(APIHelper.mapValueToPathItem(groupId))" + let groupIdPostEscape = groupIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{groupId}", with: groupIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateGroupContacts) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Create a group + + - parameter createGroupOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createGroup( createGroupOptions: CreateGroupOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createGroupWithRequestBuilder(createGroupOptions: createGroupOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create a group + - POST /groups + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createGroupOptions: (body) + - returns: RequestBuilder + */ + open class func createGroupWithRequestBuilder(createGroupOptions: CreateGroupOptions) -> RequestBuilder { + let path = "/groups" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createGroupOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete group + + - parameter groupId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteGroup( groupId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteGroupWithRequestBuilder(groupId: groupId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete group + - DELETE /groups/{groupId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter groupId: (path) + - returns: RequestBuilder + */ + open class func deleteGroupWithRequestBuilder(groupId: UUID) -> RequestBuilder { + var path = "/groups/{groupId}" + let groupIdPreEscape = "\(APIHelper.mapValueToPathItem(groupId))" + let groupIdPostEscape = groupIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{groupId}", with: groupIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllGroups: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all Contact Groups in paginated format + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllGroups( page: Int? = nil, size: Int? = nil, sort: Sort_getAllGroups? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllGroupsWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all Contact Groups in paginated format + - GET /groups/paginated + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAllGroupsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllGroups? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/groups/paginated" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get group + + - parameter groupId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getGroup( groupId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getGroupWithRequestBuilder(groupId: groupId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get group + - GET /groups/{groupId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter groupId: (path) + - returns: RequestBuilder + */ + open class func getGroupWithRequestBuilder(groupId: UUID) -> RequestBuilder { + var path = "/groups/{groupId}" + let groupIdPreEscape = "\(APIHelper.mapValueToPathItem(groupId))" + let groupIdPostEscape = groupIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{groupId}", with: groupIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get group and contacts belonging to it + + - parameter groupId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getGroupWithContacts( groupId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getGroupWithContactsWithRequestBuilder(groupId: groupId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get group and contacts belonging to it + - GET /groups/{groupId}/contacts + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter groupId: (path) + - returns: RequestBuilder + */ + open class func getGroupWithContactsWithRequestBuilder(groupId: UUID) -> RequestBuilder { + var path = "/groups/{groupId}/contacts" + let groupIdPreEscape = "\(APIHelper.mapValueToPathItem(groupId))" + let groupIdPostEscape = groupIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{groupId}", with: groupIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getGroupWithContactsPaginated: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter groupId: (path) + - parameter page: (query) Optional page index in group contact pagination (optional, default to 0) + - parameter size: (query) Optional page size in group contact pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getGroupWithContactsPaginated( groupId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getGroupWithContactsPaginated? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getGroupWithContactsPaginatedWithRequestBuilder(groupId: groupId, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /groups/{groupId}/contacts-paginated + - Get group and paginated contacts belonging to it + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter groupId: (path) + - parameter page: (query) Optional page index in group contact pagination (optional, default to 0) + - parameter size: (query) Optional page size in group contact pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getGroupWithContactsPaginatedWithRequestBuilder(groupId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getGroupWithContactsPaginated? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/groups/{groupId}/contacts-paginated" + let groupIdPreEscape = "\(APIHelper.mapValueToPathItem(groupId))" + let groupIdPostEscape = groupIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{groupId}", with: groupIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get all groups + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[GroupProjection]> + */ + open class func getGroups(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[GroupProjection]> { + let deferred = Promise<[GroupProjection]>.pending() + getGroupsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all groups + - GET /groups + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[GroupProjection]> + */ + open class func getGroupsWithRequestBuilder() -> RequestBuilder<[GroupProjection]> { + let path = "/groups" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[GroupProjection]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Remove contacts from a group + + - parameter groupId: (path) + - parameter updateGroupContacts: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func removeContactsFromGroup( groupId: UUID, updateGroupContacts: UpdateGroupContacts, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + removeContactsFromGroupWithRequestBuilder(groupId: groupId, updateGroupContacts: updateGroupContacts).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Remove contacts from a group + - DELETE /groups/{groupId}/contacts + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter groupId: (path) + - parameter updateGroupContacts: (body) + - returns: RequestBuilder + */ + open class func removeContactsFromGroupWithRequestBuilder(groupId: UUID, updateGroupContacts: UpdateGroupContacts) -> RequestBuilder { + var path = "/groups/{groupId}/contacts" + let groupIdPreEscape = "\(APIHelper.mapValueToPathItem(groupId))" + let groupIdPostEscape = groupIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{groupId}", with: groupIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateGroupContacts) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/InboxControllerAPI.swift b/mailslurp/APIs/InboxControllerAPI.swift new file mode 100644 index 00000000..049a650d --- /dev/null +++ b/mailslurp/APIs/InboxControllerAPI.swift @@ -0,0 +1,2030 @@ +// +// InboxControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class InboxControllerAPI : NSObject { + /** + * enum for parameter inboxType + */ + public enum InboxType_createInbox: String, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + + /** + Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. + + - parameter emailAddress: (query) A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional) + - parameter tags: (query) Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional) + - parameter name: (query) Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional) + - parameter _description: (query) Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional) + - parameter useDomainPool: (query) Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional) + - parameter favourite: (query) Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional) + - parameter expiresAt: (query) Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional) + - parameter expiresIn: (query) Number of milliseconds that inbox should exist for (optional) + - parameter allowTeamAccess: (query) DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional) + - parameter inboxType: (query) HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional) + - parameter virtualInbox: (query) Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createInbox( emailAddress: String? = nil, tags: [String]? = nil, name: String? = nil, _description: String? = nil, useDomainPool: Bool? = nil, favourite: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, allowTeamAccess: Bool? = nil, inboxType: InboxType_createInbox? = nil, virtualInbox: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createInboxWithRequestBuilder(emailAddress: emailAddress, tags: tags, name: name, _description: _description, useDomainPool: useDomainPool, favourite: favourite, expiresAt: expiresAt, expiresIn: expiresIn, allowTeamAccess: allowTeamAccess, inboxType: inboxType, virtualInbox: virtualInbox).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. + - POST /inboxes + - Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailAddress: (query) A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional) + - parameter tags: (query) Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional) + - parameter name: (query) Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional) + - parameter _description: (query) Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional) + - parameter useDomainPool: (query) Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional) + - parameter favourite: (query) Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional) + - parameter expiresAt: (query) Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional) + - parameter expiresIn: (query) Number of milliseconds that inbox should exist for (optional) + - parameter allowTeamAccess: (query) DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional) + - parameter inboxType: (query) HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional) + - parameter virtualInbox: (query) Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional) + - returns: RequestBuilder + */ + open class func createInboxWithRequestBuilder(emailAddress: String? = nil, tags: [String]? = nil, name: String? = nil, _description: String? = nil, useDomainPool: Bool? = nil, favourite: Bool? = nil, expiresAt: Date? = nil, expiresIn: Int64? = nil, allowTeamAccess: Bool? = nil, inboxType: InboxType_createInbox? = nil, virtualInbox: Bool? = nil) -> RequestBuilder { + let path = "/inboxes" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "emailAddress": emailAddress?.encodeToJSON(), + "tags": tags?.encodeToJSON(), + "name": name?.encodeToJSON(), + "description": _description?.encodeToJSON(), + "useDomainPool": useDomainPool?.encodeToJSON(), + "favourite": favourite?.encodeToJSON(), + "expiresAt": expiresAt?.encodeToJSON(), + "expiresIn": expiresIn?.encodeToJSON(), + "allowTeamAccess": allowTeamAccess?.encodeToJSON(), + "inboxType": inboxType?.encodeToJSON(), + "virtualInbox": virtualInbox?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Create an inbox ruleset + + - parameter inboxId: (path) inboxId + - parameter createInboxRulesetOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createInboxRuleset( inboxId: UUID, createInboxRulesetOptions: CreateInboxRulesetOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createInboxRulesetWithRequestBuilder(inboxId: inboxId, createInboxRulesetOptions: createInboxRulesetOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an inbox ruleset + - POST /inboxes/{inboxId}/rulesets + - Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) inboxId + - parameter createInboxRulesetOptions: (body) + - returns: RequestBuilder + */ + open class func createInboxRulesetWithRequestBuilder(inboxId: UUID, createInboxRulesetOptions: CreateInboxRulesetOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}/rulesets" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createInboxRulesetOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Create an inbox with default options. Uses MailSlurp domain pool address and is private. + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createInboxWithDefaults(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createInboxWithDefaultsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an inbox with default options. Uses MailSlurp domain pool address and is private. + - POST /inboxes/withDefaults + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func createInboxWithDefaultsWithRequestBuilder() -> RequestBuilder { + let path = "/inboxes/withDefaults" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Create an inbox with options. Extended options for inbox creation. + + - parameter createInboxDto: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createInboxWithOptions( createInboxDto: CreateInboxDto, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createInboxWithOptionsWithRequestBuilder(createInboxDto: createInboxDto).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an inbox with options. Extended options for inbox creation. + - POST /inboxes/withOptions + - Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createInboxDto: (body) + - returns: RequestBuilder + */ + open class func createInboxWithOptionsWithRequestBuilder(createInboxDto: CreateInboxDto) -> RequestBuilder { + let path = "/inboxes/withOptions" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createInboxDto) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete all emails in a given inboxes. + + - parameter inboxId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAllInboxEmails( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAllInboxEmailsWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all emails in a given inboxes. + - DELETE /inboxes/{inboxId}/deleteAllInboxEmails + - Deletes all emails in an inbox. Be careful as emails cannot be recovered + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - returns: RequestBuilder + */ + open class func deleteAllInboxEmailsWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + var path = "/inboxes/{inboxId}/deleteAllInboxEmails" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete all inboxes + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAllInboxes(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAllInboxesWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all inboxes + - DELETE /inboxes + - Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func deleteAllInboxesWithRequestBuilder() -> RequestBuilder { + let path = "/inboxes" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete inbox + + - parameter inboxId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteInbox( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteInboxWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete inbox + - DELETE /inboxes/{inboxId} + - Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - returns: RequestBuilder + */ + open class func deleteInboxWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + var path = "/inboxes/{inboxId}" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Does inbox exist + + - parameter emailAddress: (query) Email address + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func doesInboxExist( emailAddress: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + doesInboxExistWithRequestBuilder(emailAddress: emailAddress).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Does inbox exist + - GET /inboxes/exists + - Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailAddress: (query) Email address + - returns: RequestBuilder + */ + open class func doesInboxExistWithRequestBuilder(emailAddress: String) -> RequestBuilder { + let path = "/inboxes/exists" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "emailAddress": emailAddress.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Remove expired inboxes + + - parameter before: (query) Optional expired at before flag to flush expired inboxes that have expired before the given time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func flushExpired( before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + flushExpiredWithRequestBuilder(before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Remove expired inboxes + - DELETE /inboxes/expired + - Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter before: (query) Optional expired at before flag to flush expired inboxes that have expired before the given time (optional) + - returns: RequestBuilder + */ + open class func flushExpiredWithRequestBuilder(before: Date? = nil) -> RequestBuilder { + let path = "/inboxes/expired" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllInboxes: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + * enum for parameter inboxType + */ + public enum InboxType_getAllInboxes: String, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + + /** + List All Inboxes Paginated + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter favourite: (query) Optionally filter results for favourites only (optional, default to false) + - parameter search: (query) Optionally filter by search words partial matching ID, tags, name, and email address (optional) + - parameter tag: (query) Optionally filter by tags. Will return inboxes that include given tags (optional) + - parameter teamAccess: (query) DEPRECATED. Optionally filter by team access. (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - parameter inboxType: (query) Optional filter by inbox type (optional) + - parameter domainId: (query) Optional domain ID filter (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllInboxes( page: Int? = nil, size: Int? = nil, sort: Sort_getAllInboxes? = nil, favourite: Bool? = nil, search: String? = nil, tag: String? = nil, teamAccess: Bool? = nil, since: Date? = nil, before: Date? = nil, inboxType: InboxType_getAllInboxes? = nil, domainId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllInboxesWithRequestBuilder(page: page, size: size, sort: sort, favourite: favourite, search: search, tag: tag, teamAccess: teamAccess, since: since, before: before, inboxType: inboxType, domainId: domainId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List All Inboxes Paginated + - GET /inboxes/paginated + - List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter favourite: (query) Optionally filter results for favourites only (optional, default to false) + - parameter search: (query) Optionally filter by search words partial matching ID, tags, name, and email address (optional) + - parameter tag: (query) Optionally filter by tags. Will return inboxes that include given tags (optional) + - parameter teamAccess: (query) DEPRECATED. Optionally filter by team access. (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - parameter inboxType: (query) Optional filter by inbox type (optional) + - parameter domainId: (query) Optional domain ID filter (optional) + - returns: RequestBuilder + */ + open class func getAllInboxesWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllInboxes? = nil, favourite: Bool? = nil, search: String? = nil, tag: String? = nil, teamAccess: Bool? = nil, since: Date? = nil, before: Date? = nil, inboxType: InboxType_getAllInboxes? = nil, domainId: UUID? = nil) -> RequestBuilder { + let path = "/inboxes/paginated" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "favourite": favourite?.encodeToJSON(), + "search": search?.encodeToJSON(), + "tag": tag?.encodeToJSON(), + "teamAccess": teamAccess?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "inboxType": inboxType?.encodeToJSON(), + "domainId": domainId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getDeliveryStatusesByInboxId: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter inboxId: (path) + - parameter page: (query) Optional page index in delivery status list pagination (optional, default to 0) + - parameter size: (query) Optional page size in delivery status list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getDeliveryStatusesByInboxId( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getDeliveryStatusesByInboxId? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getDeliveryStatusesByInboxIdWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /inboxes/{inboxId}/delivery-status + - Get all email delivery statuses for an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter page: (query) Optional page index in delivery status list pagination (optional, default to 0) + - parameter size: (query) Optional page size in delivery status list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getDeliveryStatusesByInboxIdWithRequestBuilder(inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getDeliveryStatusesByInboxId? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/inboxes/{inboxId}/delivery-status" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. + + - parameter inboxId: (path) Id of inbox that emails belongs to + - parameter size: (query) Alias for limit. Assessed first before assessing any passed limit. (optional) + - parameter limit: (query) Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional) + - parameter sort: (query) Sort the results by received date and direction ASC or DESC (optional) + - parameter retryTimeout: (query) Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional) + - parameter delayTimeout: (query) (optional) + - parameter minCount: (query) Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional) + - parameter unreadOnly: (query) (optional) + - parameter before: (query) Exclude emails received after this ISO 8601 date time (optional) + - parameter since: (query) Exclude emails received before this ISO 8601 date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[EmailPreview]> + */ + open class func getEmails( inboxId: UUID, size: Int? = nil, limit: Int? = nil, sort: Sort_getEmails? = nil, retryTimeout: Int64? = nil, delayTimeout: Int64? = nil, minCount: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[EmailPreview]> { + let deferred = Promise<[EmailPreview]>.pending() + getEmailsWithRequestBuilder(inboxId: inboxId, size: size, limit: limit, sort: sort, retryTimeout: retryTimeout, delayTimeout: delayTimeout, minCount: minCount, unreadOnly: unreadOnly, before: before, since: since).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. + - GET /inboxes/{inboxId}/emails + - List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) Id of inbox that emails belongs to + - parameter size: (query) Alias for limit. Assessed first before assessing any passed limit. (optional) + - parameter limit: (query) Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional) + - parameter sort: (query) Sort the results by received date and direction ASC or DESC (optional) + - parameter retryTimeout: (query) Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional) + - parameter delayTimeout: (query) (optional) + - parameter minCount: (query) Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional) + - parameter unreadOnly: (query) (optional) + - parameter before: (query) Exclude emails received after this ISO 8601 date time (optional) + - parameter since: (query) Exclude emails received before this ISO 8601 date time (optional) + - returns: RequestBuilder<[EmailPreview]> + */ + open class func getEmailsWithRequestBuilder(inboxId: UUID, size: Int? = nil, limit: Int? = nil, sort: Sort_getEmails? = nil, retryTimeout: Int64? = nil, delayTimeout: Int64? = nil, minCount: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil) -> RequestBuilder<[EmailPreview]> { + var path = "/inboxes/{inboxId}/emails" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "size": size?.encodeToJSON(), + "limit": limit?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "retryTimeout": retryTimeout?.encodeToJSON(), + "delayTimeout": delayTimeout?.encodeToJSON(), + "minCount": minCount?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "before": before?.encodeToJSON(), + "since": since?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[EmailPreview]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter inboxId: (query) Inbox ID (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getImapSmtpAccess( inboxId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getImapSmtpAccessWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /inboxes/imap-smtp-access + - Get IMAP and SMTP access usernames and passwords + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Inbox ID (optional) + - returns: RequestBuilder + */ + open class func getImapSmtpAccessWithRequestBuilder(inboxId: UUID? = nil) -> RequestBuilder { + let path = "/inboxes/imap-smtp-access" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get Inbox. Returns properties of an inbox. + + - parameter inboxId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInbox( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get Inbox. Returns properties of an inbox. + - GET /inboxes/{inboxId} + - Returns an inbox's properties, including its email address and ID. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - returns: RequestBuilder + */ + open class func getInboxWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + var path = "/inboxes/{inboxId}" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Search for an inbox with the provided email address + + - parameter emailAddress: (query) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxByEmailAddress( emailAddress: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxByEmailAddressWithRequestBuilder(emailAddress: emailAddress).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Search for an inbox with the provided email address + - GET /inboxes/byEmailAddress + - Get a inbox result by email address + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailAddress: (query) + - returns: RequestBuilder + */ + open class func getInboxByEmailAddressWithRequestBuilder(emailAddress: String) -> RequestBuilder { + let path = "/inboxes/byEmailAddress" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "emailAddress": emailAddress.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Search for an inbox with the given name + + - parameter name: (query) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxByName( name: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxByNameWithRequestBuilder(name: name).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Search for an inbox with the given name + - GET /inboxes/byName + - Get a inbox result by name + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter name: (query) + - returns: RequestBuilder + */ + open class func getInboxByNameWithRequestBuilder(name: String) -> RequestBuilder { + let path = "/inboxes/byName" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "name": name.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get total inbox count + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxCount(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxCountWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get total inbox count + - GET /inboxes/count + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getInboxCountWithRequestBuilder() -> RequestBuilder { + let path = "/inboxes/count" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get email count in inbox + + - parameter inboxId: (path) Id of inbox that emails belongs to + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxEmailCount( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxEmailCountWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get email count in inbox + - GET /inboxes/{inboxId}/emails/count + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) Id of inbox that emails belongs to + - returns: RequestBuilder + */ + open class func getInboxEmailCountWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + var path = "/inboxes/{inboxId}/emails/count" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getInboxEmailsPaginated: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get inbox emails paginated + + - parameter inboxId: (path) Id of inbox that emails belongs to + - parameter page: (query) Optional page index in inbox emails list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox emails list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by received after given date time (optional) + - parameter before: (query) Optional filter by received before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxEmailsPaginated( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxEmailsPaginated? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxEmailsPaginatedWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get inbox emails paginated + - GET /inboxes/{inboxId}/emails/paginated + - Get a paginated list of emails in an inbox. Does not hold connections open. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) Id of inbox that emails belongs to + - parameter page: (query) Optional page index in inbox emails list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox emails list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by received after given date time (optional) + - parameter before: (query) Optional filter by received before given date time (optional) + - returns: RequestBuilder + */ + open class func getInboxEmailsPaginatedWithRequestBuilder(inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxEmailsPaginated? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/inboxes/{inboxId}/emails/paginated" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get all inbox IDs + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxIds(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxIdsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all inbox IDs + - GET /inboxes/ids + - Get list of inbox IDs + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getInboxIdsWithRequestBuilder() -> RequestBuilder { + let path = "/inboxes/ids" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getInboxSentEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get Inbox Sent Emails + + - parameter inboxId: (path) + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional sent email search (optional) + - parameter since: (query) Optional filter by sent after given date time (optional) + - parameter before: (query) Optional filter by sent before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxSentEmails( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxSentEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxSentEmailsWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get Inbox Sent Emails + - GET /inboxes/{inboxId}/sent + - Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional sent email search (optional) + - parameter since: (query) Optional filter by sent after given date time (optional) + - parameter before: (query) Optional filter by sent before given date time (optional) + - returns: RequestBuilder + */ + open class func getInboxSentEmailsWithRequestBuilder(inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxSentEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/inboxes/{inboxId}/sent" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get inbox tags + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[String]> + */ + open class func getInboxTags(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[String]> { + let deferred = Promise<[String]>.pending() + getInboxTagsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get inbox tags + - GET /inboxes/tags + - Get all inbox tags + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[String]> + */ + open class func getInboxTagsWithRequestBuilder() -> RequestBuilder<[String]> { + let path = "/inboxes/tags" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[String]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getInboxes: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List Inboxes and email addresses + + - parameter size: (query) Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional, default to 100) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[InboxDto]> + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func getInboxes( size: Int? = nil, sort: Sort_getInboxes? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[InboxDto]> { + let deferred = Promise<[InboxDto]>.pending() + getInboxesWithRequestBuilder(size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List Inboxes and email addresses + - GET /inboxes + - List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using a limit and sort parameter. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter size: (query) Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional, default to 100) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - returns: RequestBuilder<[InboxDto]> + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func getInboxesWithRequestBuilder(size: Int? = nil, sort: Sort_getInboxes? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder<[InboxDto]> { + let path = "/inboxes" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[InboxDto]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. + + - parameter inboxId: (query) ID of the inbox you want to get the latest email from + - parameter timeoutMillis: (query) Timeout milliseconds to wait for latest email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getLatestEmailInInbox( inboxId: UUID, timeoutMillis: Int64, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getLatestEmailInInboxWithRequestBuilder(inboxId: inboxId, timeoutMillis: timeoutMillis).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. + - GET /inboxes/getLatestEmail + - Get the newest email in an inbox or wait for one to arrive + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) ID of the inbox you want to get the latest email from + - parameter timeoutMillis: (query) Timeout milliseconds to wait for latest email + - returns: RequestBuilder + */ + open class func getLatestEmailInInboxWithRequestBuilder(inboxId: UUID, timeoutMillis: Int64) -> RequestBuilder { + let path = "/inboxes/getLatestEmail" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + "timeoutMillis": timeoutMillis.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getOrganizationInboxes: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List Organization Inboxes Paginated + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getOrganizationInboxes( page: Int? = nil, size: Int? = nil, sort: Sort_getOrganizationInboxes? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getOrganizationInboxesWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List Organization Inboxes Paginated + - GET /inboxes/organization + - List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - returns: RequestBuilder + */ + open class func getOrganizationInboxesWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getOrganizationInboxes? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/inboxes/organization" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_listInboxRulesets: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List inbox rulesets + + - parameter inboxId: (path) + - parameter page: (query) Optional page index in inbox ruleset list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox ruleset list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func listInboxRulesets( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_listInboxRulesets? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + listInboxRulesetsWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List inbox rulesets + - GET /inboxes/{inboxId}/rulesets + - List all rulesets attached to an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter page: (query) Optional page index in inbox ruleset list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox ruleset list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - returns: RequestBuilder + */ + open class func listInboxRulesetsWithRequestBuilder(inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_listInboxRulesets? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/inboxes/{inboxId}/rulesets" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_listInboxTrackingPixels: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List inbox tracking pixels + + - parameter inboxId: (path) + - parameter page: (query) Optional page index in inbox tracking pixel list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox tracking pixel list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func listInboxTrackingPixels( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_listInboxTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + listInboxTrackingPixelsWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List inbox tracking pixels + - GET /inboxes/{inboxId}/tracking-pixels + - List all tracking pixels sent from an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter page: (query) Optional page index in inbox tracking pixel list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox tracking pixel list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Optional filter by created after given date time (optional) + - parameter before: (query) Optional filter by created before given date time (optional) + - returns: RequestBuilder + */ + open class func listInboxTrackingPixelsWithRequestBuilder(inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_listInboxTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/inboxes/{inboxId}/tracking-pixels" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send Email + + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendEmail( inboxId: UUID, sendEmailOptions: SendEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendEmailWithRequestBuilder(inboxId: inboxId, sendEmailOptions: sendEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send Email + - POST /inboxes/{inboxId} + - Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendEmailOptions: (body) + - returns: RequestBuilder + */ + open class func sendEmailWithRequestBuilder(inboxId: UUID, sendEmailOptions: SendEmailOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: sendEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send email and return sent confirmation + + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendEmailAndConfirm( inboxId: UUID, sendEmailOptions: SendEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendEmailAndConfirmWithRequestBuilder(inboxId: inboxId, sendEmailOptions: sendEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send email and return sent confirmation + - POST /inboxes/{inboxId}/confirm + - Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendEmailOptions: (body) + - returns: RequestBuilder + */ + open class func sendEmailAndConfirmWithRequestBuilder(inboxId: UUID, sendEmailOptions: SendEmailOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}/confirm" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: sendEmailOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send email with queue + + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter validateBeforeEnqueue: (query) Validate before adding to queue + - parameter sendEmailOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendEmailWithQueue( inboxId: UUID, validateBeforeEnqueue: Bool, sendEmailOptions: SendEmailOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendEmailWithQueueWithRequestBuilder(inboxId: inboxId, validateBeforeEnqueue: validateBeforeEnqueue, sendEmailOptions: sendEmailOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send email with queue + - POST /inboxes/{inboxId}/with-queue + - Send an email using a queue. Will place the email onto a queue that will then be processed and sent. Use this queue method to enable any failed email sending to be recovered. This will prevent lost emails when sending if your account encounters a block or payment issue. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter validateBeforeEnqueue: (query) Validate before adding to queue + - parameter sendEmailOptions: (body) + - returns: RequestBuilder + */ + open class func sendEmailWithQueueWithRequestBuilder(inboxId: UUID, validateBeforeEnqueue: Bool, sendEmailOptions: SendEmailOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}/with-queue" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: sendEmailOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "validateBeforeEnqueue": validateBeforeEnqueue.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send email using an SMTP mail envelope and message body and return sent confirmation + + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendSMTPEnvelopeOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendSmtpEnvelope( inboxId: UUID, sendSMTPEnvelopeOptions: SendSMTPEnvelopeOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendSmtpEnvelopeWithRequestBuilder(inboxId: inboxId, sendSMTPEnvelopeOptions: sendSMTPEnvelopeOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send email using an SMTP mail envelope and message body and return sent confirmation + - POST /inboxes/{inboxId}/smtp-envelope + - Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of the inbox you want to send the email from + - parameter sendSMTPEnvelopeOptions: (body) + - returns: RequestBuilder + */ + open class func sendSmtpEnvelopeWithRequestBuilder(inboxId: UUID, sendSMTPEnvelopeOptions: SendSMTPEnvelopeOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}/smtp-envelope" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: sendSMTPEnvelopeOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send a test email to inbox + + - parameter inboxId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendTestEmail( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendTestEmailWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send a test email to inbox + - POST /inboxes/{inboxId}/send-test-email + - Send an inbox a test email to test email receiving is working + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - returns: RequestBuilder + */ + open class func sendTestEmailWithRequestBuilder(inboxId: UUID) -> RequestBuilder { + var path = "/inboxes/{inboxId}/send-test-email" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Set inbox favourited state + + - parameter inboxId: (path) ID of inbox to set favourite state + - parameter setInboxFavouritedOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func setInboxFavourited( inboxId: UUID, setInboxFavouritedOptions: SetInboxFavouritedOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + setInboxFavouritedWithRequestBuilder(inboxId: inboxId, setInboxFavouritedOptions: setInboxFavouritedOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Set inbox favourited state + - PUT /inboxes/{inboxId}/favourite + - Set and return new favourite state for an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) ID of inbox to set favourite state + - parameter setInboxFavouritedOptions: (body) + - returns: RequestBuilder + */ + open class func setInboxFavouritedWithRequestBuilder(inboxId: UUID, setInboxFavouritedOptions: SetInboxFavouritedOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}/favourite" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: setInboxFavouritedOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Update Inbox. Change name and description. Email address is not editable. + + - parameter inboxId: (path) + - parameter updateInboxOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func updateInbox( inboxId: UUID, updateInboxOptions: UpdateInboxOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + updateInboxWithRequestBuilder(inboxId: inboxId, updateInboxOptions: updateInboxOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Update Inbox. Change name and description. Email address is not editable. + - PATCH /inboxes/{inboxId} + - Update editable fields on an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter updateInboxOptions: (body) + - returns: RequestBuilder + */ + open class func updateInboxWithRequestBuilder(inboxId: UUID, updateInboxOptions: UpdateInboxOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateInboxOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/InboxForwarderControllerAPI.swift b/mailslurp/APIs/InboxForwarderControllerAPI.swift new file mode 100644 index 00000000..93ed8be7 --- /dev/null +++ b/mailslurp/APIs/InboxForwarderControllerAPI.swift @@ -0,0 +1,449 @@ +// +// InboxForwarderControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class InboxForwarderControllerAPI : NSObject { + /** + Create an inbox forwarder + + - parameter inboxId: (query) Inbox id to attach forwarder to + - parameter createInboxForwarderOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createNewInboxForwarder( inboxId: UUID, createInboxForwarderOptions: CreateInboxForwarderOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createNewInboxForwarderWithRequestBuilder(inboxId: inboxId, createInboxForwarderOptions: createInboxForwarderOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an inbox forwarder + - POST /forwarders + - Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Inbox id to attach forwarder to + - parameter createInboxForwarderOptions: (body) + - returns: RequestBuilder + */ + open class func createNewInboxForwarderWithRequestBuilder(inboxId: UUID, createInboxForwarderOptions: CreateInboxForwarderOptions) -> RequestBuilder { + let path = "/forwarders" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createInboxForwarderOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete an inbox forwarder + + - parameter _id: (path) ID of inbox forwarder + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteInboxForwarder( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteInboxForwarderWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete an inbox forwarder + - DELETE /forwarders/{id} + - Delete inbox forwarder + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of inbox forwarder + - returns: RequestBuilder + */ + open class func deleteInboxForwarderWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/forwarders/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete inbox forwarders + + - parameter inboxId: (query) Optional inbox id to attach forwarder to (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteInboxForwarders( inboxId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteInboxForwardersWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete inbox forwarders + - DELETE /forwarders + - Delete inbox forwarders. Accepts optional inboxId filter. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inbox id to attach forwarder to (optional) + - returns: RequestBuilder + */ + open class func deleteInboxForwardersWithRequestBuilder(inboxId: UUID? = nil) -> RequestBuilder { + let path = "/forwarders" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get an inbox forwarder + + - parameter _id: (path) ID of inbox forwarder + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxForwarder( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxForwarderWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get an inbox forwarder + - GET /forwarders/{id} + - Get inbox ruleset + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of inbox forwarder + - returns: RequestBuilder + */ + open class func getInboxForwarderWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/forwarders/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getInboxForwarders: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List inbox forwarders + + - parameter inboxId: (query) Optional inbox id to get forwarders from (optional) + - parameter page: (query) Optional page index in inbox forwarder list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox forwarder list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxForwarders( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxForwarders? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxForwardersWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List inbox forwarders + - GET /forwarders + - List all forwarders attached to an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inbox id to get forwarders from (optional) + - parameter page: (query) Optional page index in inbox forwarder list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox forwarder list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getInboxForwardersWithRequestBuilder(inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxForwarders? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/forwarders" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Test an inbox forwarder + + - parameter _id: (path) ID of inbox forwarder + - parameter inboxForwarderTestOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testInboxForwarder( _id: UUID, inboxForwarderTestOptions: InboxForwarderTestOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testInboxForwarderWithRequestBuilder(_id: _id, inboxForwarderTestOptions: inboxForwarderTestOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Test an inbox forwarder + - POST /forwarders/{id}/test + - Test an inbox forwarder + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of inbox forwarder + - parameter inboxForwarderTestOptions: (body) + - returns: RequestBuilder + */ + open class func testInboxForwarderWithRequestBuilder(_id: UUID, inboxForwarderTestOptions: InboxForwarderTestOptions) -> RequestBuilder { + var path = "/forwarders/{id}/test" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: inboxForwarderTestOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Test inbox forwarders for inbox + + - parameter inboxId: (query) ID of inbox + - parameter inboxForwarderTestOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testInboxForwardersForInbox( inboxId: UUID, inboxForwarderTestOptions: InboxForwarderTestOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testInboxForwardersForInboxWithRequestBuilder(inboxId: inboxId, inboxForwarderTestOptions: inboxForwarderTestOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Test inbox forwarders for inbox + - PUT /forwarders + - Test inbox forwarders for inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) ID of inbox + - parameter inboxForwarderTestOptions: (body) + - returns: RequestBuilder + */ + open class func testInboxForwardersForInboxWithRequestBuilder(inboxId: UUID, inboxForwarderTestOptions: InboxForwarderTestOptions) -> RequestBuilder { + let path = "/forwarders" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: inboxForwarderTestOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Test new inbox forwarder + + - parameter testNewInboxForwarderOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testNewInboxForwarder( testNewInboxForwarderOptions: TestNewInboxForwarderOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testNewInboxForwarderWithRequestBuilder(testNewInboxForwarderOptions: testNewInboxForwarderOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Test new inbox forwarder + - PATCH /forwarders + - Test new inbox forwarder + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter testNewInboxForwarderOptions: (body) + - returns: RequestBuilder + */ + open class func testNewInboxForwarderWithRequestBuilder(testNewInboxForwarderOptions: TestNewInboxForwarderOptions) -> RequestBuilder { + let path = "/forwarders" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: testNewInboxForwarderOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/InboxRulesetControllerAPI.swift b/mailslurp/APIs/InboxRulesetControllerAPI.swift new file mode 100644 index 00000000..eaa6f26c --- /dev/null +++ b/mailslurp/APIs/InboxRulesetControllerAPI.swift @@ -0,0 +1,449 @@ +// +// InboxRulesetControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class InboxRulesetControllerAPI : NSObject { + /** + Create an inbox ruleset + + - parameter inboxId: (query) Inbox id to attach ruleset to + - parameter createInboxRulesetOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createNewInboxRuleset( inboxId: UUID, createInboxRulesetOptions: CreateInboxRulesetOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createNewInboxRulesetWithRequestBuilder(inboxId: inboxId, createInboxRulesetOptions: createInboxRulesetOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create an inbox ruleset + - POST /rulesets + - Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Inbox id to attach ruleset to + - parameter createInboxRulesetOptions: (body) + - returns: RequestBuilder + */ + open class func createNewInboxRulesetWithRequestBuilder(inboxId: UUID, createInboxRulesetOptions: CreateInboxRulesetOptions) -> RequestBuilder { + let path = "/rulesets" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createInboxRulesetOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete an inbox ruleset + + - parameter _id: (path) ID of inbox ruleset + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteInboxRuleset( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteInboxRulesetWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete an inbox ruleset + - DELETE /rulesets/{id} + - Delete inbox ruleset + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of inbox ruleset + - returns: RequestBuilder + */ + open class func deleteInboxRulesetWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/rulesets/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete inbox rulesets + + - parameter inboxId: (query) Optional inbox id to attach ruleset to (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteInboxRulesets( inboxId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteInboxRulesetsWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete inbox rulesets + - DELETE /rulesets + - Delete inbox rulesets. Accepts optional inboxId filter. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inbox id to attach ruleset to (optional) + - returns: RequestBuilder + */ + open class func deleteInboxRulesetsWithRequestBuilder(inboxId: UUID? = nil) -> RequestBuilder { + let path = "/rulesets" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get an inbox ruleset + + - parameter _id: (path) ID of inbox ruleset + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxRuleset( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxRulesetWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get an inbox ruleset + - GET /rulesets/{id} + - Get inbox ruleset + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of inbox ruleset + - returns: RequestBuilder + */ + open class func getInboxRulesetWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/rulesets/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getInboxRulesets: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List inbox rulesets + + - parameter inboxId: (query) Optional inbox id to get rulesets from (optional) + - parameter page: (query) Optional page index in inbox ruleset list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox ruleset list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxRulesets( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxRulesets? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxRulesetsWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List inbox rulesets + - GET /rulesets + - List all rulesets attached to an inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inbox id to get rulesets from (optional) + - parameter page: (query) Optional page index in inbox ruleset list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox ruleset list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getInboxRulesetsWithRequestBuilder(inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxRulesets? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/rulesets" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Test an inbox ruleset + + - parameter _id: (path) ID of inbox ruleset + - parameter inboxRulesetTestOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testInboxRuleset( _id: UUID, inboxRulesetTestOptions: InboxRulesetTestOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testInboxRulesetWithRequestBuilder(_id: _id, inboxRulesetTestOptions: inboxRulesetTestOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Test an inbox ruleset + - POST /rulesets/{id}/test + - Test an inbox ruleset + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) ID of inbox ruleset + - parameter inboxRulesetTestOptions: (body) + - returns: RequestBuilder + */ + open class func testInboxRulesetWithRequestBuilder(_id: UUID, inboxRulesetTestOptions: InboxRulesetTestOptions) -> RequestBuilder { + var path = "/rulesets/{id}/test" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: inboxRulesetTestOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Test inbox rulesets for inbox + + - parameter inboxId: (query) ID of inbox + - parameter inboxRulesetTestOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testInboxRulesetsForInbox( inboxId: UUID, inboxRulesetTestOptions: InboxRulesetTestOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testInboxRulesetsForInboxWithRequestBuilder(inboxId: inboxId, inboxRulesetTestOptions: inboxRulesetTestOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Test inbox rulesets for inbox + - PUT /rulesets + - Test inbox rulesets for inbox + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) ID of inbox + - parameter inboxRulesetTestOptions: (body) + - returns: RequestBuilder + */ + open class func testInboxRulesetsForInboxWithRequestBuilder(inboxId: UUID, inboxRulesetTestOptions: InboxRulesetTestOptions) -> RequestBuilder { + let path = "/rulesets" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: inboxRulesetTestOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Test new inbox ruleset + + - parameter testNewInboxRulesetOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testNewInboxRuleset( testNewInboxRulesetOptions: TestNewInboxRulesetOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testNewInboxRulesetWithRequestBuilder(testNewInboxRulesetOptions: testNewInboxRulesetOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Test new inbox ruleset + - PATCH /rulesets + - Test new inbox ruleset + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter testNewInboxRulesetOptions: (body) + - returns: RequestBuilder + */ + open class func testNewInboxRulesetWithRequestBuilder(testNewInboxRulesetOptions: TestNewInboxRulesetOptions) -> RequestBuilder { + let path = "/rulesets" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: testNewInboxRulesetOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/MailServerControllerAPI.swift b/mailslurp/APIs/MailServerControllerAPI.swift new file mode 100644 index 00000000..3dda44ef --- /dev/null +++ b/mailslurp/APIs/MailServerControllerAPI.swift @@ -0,0 +1,205 @@ +// +// MailServerControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class MailServerControllerAPI : NSObject { + /** + Get DNS Mail Server records for a domain + + - parameter describeDomainOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func describeMailServerDomain( describeDomainOptions: DescribeDomainOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + describeMailServerDomainWithRequestBuilder(describeDomainOptions: describeDomainOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get DNS Mail Server records for a domain + - POST /mail-server/describe/domain + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter describeDomainOptions: (body) + - returns: RequestBuilder + */ + open class func describeMailServerDomainWithRequestBuilder(describeDomainOptions: DescribeDomainOptions) -> RequestBuilder { + let path = "/mail-server/describe/domain" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: describeDomainOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Lookup DNS records for a domain + + - parameter dNSLookupOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getDnsLookup( dNSLookupOptions: DNSLookupOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getDnsLookupWithRequestBuilder(dNSLookupOptions: dNSLookupOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Lookup DNS records for a domain + - POST /mail-server/describe/dns-lookup + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter dNSLookupOptions: (body) + - returns: RequestBuilder + */ + open class func getDnsLookupWithRequestBuilder(dNSLookupOptions: DNSLookupOptions) -> RequestBuilder { + let path = "/mail-server/describe/dns-lookup" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: dNSLookupOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get IP address for a domain + + - parameter name: (query) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getIpAddress( name: String, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getIpAddressWithRequestBuilder(name: name).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get IP address for a domain + - POST /mail-server/describe/ip-address + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter name: (query) + - returns: RequestBuilder + */ + open class func getIpAddressWithRequestBuilder(name: String) -> RequestBuilder { + let path = "/mail-server/describe/ip-address" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "name": name.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server. + + - parameter verifyEmailAddressOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func verifyEmailAddress( verifyEmailAddressOptions: VerifyEmailAddressOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + verifyEmailAddressWithRequestBuilder(verifyEmailAddressOptions: verifyEmailAddressOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server. + - POST /mail-server/verify/email-address + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter verifyEmailAddressOptions: (body) + - returns: RequestBuilder + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func verifyEmailAddressWithRequestBuilder(verifyEmailAddressOptions: VerifyEmailAddressOptions) -> RequestBuilder { + let path = "/mail-server/verify/email-address" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: verifyEmailAddressOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/MissedEmailControllerAPI.swift b/mailslurp/APIs/MissedEmailControllerAPI.swift new file mode 100644 index 00000000..bbd23d93 --- /dev/null +++ b/mailslurp/APIs/MissedEmailControllerAPI.swift @@ -0,0 +1,325 @@ +// +// MissedEmailControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class MissedEmailControllerAPI : NSObject { + /** + * enum for parameter sort + */ + public enum Sort_getAllMissedEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all MissedEmails in paginated format + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter inboxId: (query) Optional inbox ID filter (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllMissedEmails( page: Int? = nil, size: Int? = nil, sort: Sort_getAllMissedEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, inboxId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllMissedEmailsWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all MissedEmails in paginated format + - GET /missed-emails + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter inboxId: (query) Optional inbox ID filter (optional) + - returns: RequestBuilder + */ + open class func getAllMissedEmailsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllMissedEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, inboxId: UUID? = nil) -> RequestBuilder { + let path = "/missed-emails" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "inboxId": inboxId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllUnknownMissedEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all unknown missed emails in paginated format + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter inboxId: (query) Optional inbox ID filter (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllUnknownMissedEmails( page: Int? = nil, size: Int? = nil, sort: Sort_getAllUnknownMissedEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, inboxId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllUnknownMissedEmailsWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all unknown missed emails in paginated format + - GET /missed-emails/unknown + - Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter inboxId: (query) Optional inbox ID filter (optional) + - returns: RequestBuilder + */ + open class func getAllUnknownMissedEmailsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllUnknownMissedEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, inboxId: UUID? = nil) -> RequestBuilder { + let path = "/missed-emails/unknown" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "inboxId": inboxId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get MissedEmail + + - parameter missedEmailId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getMissedEmail( missedEmailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getMissedEmailWithRequestBuilder(missedEmailId: missedEmailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get MissedEmail + - GET /missed-emails/{missedEmailId} + - List emails that were missed due to plan limits. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter missedEmailId: (path) + - returns: RequestBuilder + */ + open class func getMissedEmailWithRequestBuilder(missedEmailId: UUID) -> RequestBuilder { + var path = "/missed-emails/{missedEmailId}" + let missedEmailIdPreEscape = "\(APIHelper.mapValueToPathItem(missedEmailId))" + let missedEmailIdPostEscape = missedEmailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{missedEmailId}", with: missedEmailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Restore missed emails + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func restoreMissedEmails(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + restoreMissedEmailsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Restore missed emails + - POST /missed-emails/restore + - If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func restoreMissedEmailsWithRequestBuilder() -> RequestBuilder { + let path = "/missed-emails/restore" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Wait for Nth missed email + + - parameter index: (query) Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 + - parameter inboxId: (query) Optional inbox ID filter (optional) + - parameter timeout: (query) Optional timeout milliseconds (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func waitForNthMissedEmail( index: Int, inboxId: UUID? = nil, timeout: Int64? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + waitForNthMissedEmailWithRequestBuilder(index: index, inboxId: inboxId, timeout: timeout, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for Nth missed email + - GET /missed-emails/waitForNthMissedEmail + - Wait for 0 based index missed email + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter index: (query) Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 + - parameter inboxId: (query) Optional inbox ID filter (optional) + - parameter timeout: (query) Optional timeout milliseconds (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func waitForNthMissedEmailWithRequestBuilder(index: Int, inboxId: UUID? = nil, timeout: Int64? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/missed-emails/waitForNthMissedEmail" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "index": index.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/PhoneControllerAPI.swift b/mailslurp/APIs/PhoneControllerAPI.swift new file mode 100644 index 00000000..1b954216 --- /dev/null +++ b/mailslurp/APIs/PhoneControllerAPI.swift @@ -0,0 +1,466 @@ +// +// PhoneControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class PhoneControllerAPI : NSObject { + /** + + - parameter createEmergencyAddressOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createEmergencyAddress( createEmergencyAddressOptions: CreateEmergencyAddressOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createEmergencyAddressWithRequestBuilder(createEmergencyAddressOptions: createEmergencyAddressOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - POST /phone/emergency-addresses + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createEmergencyAddressOptions: (body) + - returns: RequestBuilder + */ + open class func createEmergencyAddressWithRequestBuilder(createEmergencyAddressOptions: CreateEmergencyAddressOptions) -> RequestBuilder { + let path = "/phone/emergency-addresses" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createEmergencyAddressOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter addressId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteEmergencyAddress( addressId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteEmergencyAddressWithRequestBuilder(addressId: addressId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - DELETE /phone/emergency-addresses/{addressId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter addressId: (path) + - returns: RequestBuilder + */ + open class func deleteEmergencyAddressWithRequestBuilder(addressId: UUID) -> RequestBuilder { + var path = "/phone/emergency-addresses/{addressId}" + let addressIdPreEscape = "\(APIHelper.mapValueToPathItem(addressId))" + let addressIdPostEscape = addressIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{addressId}", with: addressIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter phoneNumberId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deletePhoneNumber( phoneNumberId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deletePhoneNumberWithRequestBuilder(phoneNumberId: phoneNumberId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - DELETE /phone/numbers/{phoneNumberId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneNumberId: (path) + - returns: RequestBuilder + */ + open class func deletePhoneNumberWithRequestBuilder(phoneNumberId: UUID) -> RequestBuilder { + var path = "/phone/numbers/{phoneNumberId}" + let phoneNumberIdPreEscape = "\(APIHelper.mapValueToPathItem(phoneNumberId))" + let phoneNumberIdPostEscape = phoneNumberIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{phoneNumberId}", with: phoneNumberIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter addressId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getEmergencyAddress( addressId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getEmergencyAddressWithRequestBuilder(addressId: addressId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /phone/emergency-addresses/{addressId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter addressId: (path) + - returns: RequestBuilder + */ + open class func getEmergencyAddressWithRequestBuilder(addressId: UUID) -> RequestBuilder { + var path = "/phone/emergency-addresses/{addressId}" + let addressIdPreEscape = "\(APIHelper.mapValueToPathItem(addressId))" + let addressIdPostEscape = addressIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{addressId}", with: addressIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[EmergencyAddressDto]> + */ + open class func getEmergencyAddresses(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[EmergencyAddressDto]> { + let deferred = Promise<[EmergencyAddressDto]>.pending() + getEmergencyAddressesWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /phone/emergency-addresses + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[EmergencyAddressDto]> + */ + open class func getEmergencyAddressesWithRequestBuilder() -> RequestBuilder<[EmergencyAddressDto]> { + let path = "/phone/emergency-addresses" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[EmergencyAddressDto]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter phoneNumberId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getPhoneNumber( phoneNumberId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getPhoneNumberWithRequestBuilder(phoneNumberId: phoneNumberId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /phone/numbers/{phoneNumberId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneNumberId: (path) + - returns: RequestBuilder + */ + open class func getPhoneNumberWithRequestBuilder(phoneNumberId: UUID) -> RequestBuilder { + var path = "/phone/numbers/{phoneNumberId}" + let phoneNumberIdPreEscape = "\(APIHelper.mapValueToPathItem(phoneNumberId))" + let phoneNumberIdPostEscape = phoneNumberIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{phoneNumberId}", with: phoneNumberIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter phoneCountry + */ + public enum PhoneCountry_getPhoneNumbers: String, CaseIterable { + case us = "US" + case gb = "GB" + } + + /** + * enum for parameter sort + */ + public enum Sort_getPhoneNumbers: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter phoneCountry: (query) Optional phone country (optional) + - parameter page: (query) Optional page index for list pagination (optional, default to 0) + - parameter size: (query) Optional page size for list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getPhoneNumbers( phoneCountry: PhoneCountry_getPhoneNumbers? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getPhoneNumbers? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getPhoneNumbersWithRequestBuilder(phoneCountry: phoneCountry, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /phone/numbers + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneCountry: (query) Optional phone country (optional) + - parameter page: (query) Optional page index for list pagination (optional, default to 0) + - parameter size: (query) Optional page size for list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getPhoneNumbersWithRequestBuilder(phoneCountry: PhoneCountry_getPhoneNumbers? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getPhoneNumbers? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/phone/numbers" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "phoneCountry": phoneCountry?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[PhonePlanDto]> + */ + open class func getPhonePlans(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[PhonePlanDto]> { + let deferred = Promise<[PhonePlanDto]>.pending() + getPhonePlansWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /phone/plans + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[PhonePlanDto]> + */ + open class func getPhonePlansWithRequestBuilder() -> RequestBuilder<[PhonePlanDto]> { + let path = "/phone/plans" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[PhonePlanDto]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter phoneNumberId: (path) + - parameter testPhoneNumberOptions: (body) + - parameter xTestId: (header) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func testPhoneNumberSendSms( phoneNumberId: UUID, testPhoneNumberOptions: TestPhoneNumberOptions, xTestId: String? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + testPhoneNumberSendSmsWithRequestBuilder(phoneNumberId: phoneNumberId, testPhoneNumberOptions: testPhoneNumberOptions, xTestId: xTestId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - POST /phone/numbers/{phoneNumberId}/test + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneNumberId: (path) + - parameter testPhoneNumberOptions: (body) + - parameter xTestId: (header) (optional) + - returns: RequestBuilder + */ + open class func testPhoneNumberSendSmsWithRequestBuilder(phoneNumberId: UUID, testPhoneNumberOptions: TestPhoneNumberOptions, xTestId: String? = nil) -> RequestBuilder { + var path = "/phone/numbers/{phoneNumberId}/test" + let phoneNumberIdPreEscape = "\(APIHelper.mapValueToPathItem(phoneNumberId))" + let phoneNumberIdPostEscape = phoneNumberIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{phoneNumberId}", with: phoneNumberIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: testPhoneNumberOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + "x-test-id": xTestId?.encodeToJSON(), + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/SentEmailsControllerAPI.swift b/mailslurp/APIs/SentEmailsControllerAPI.swift new file mode 100644 index 00000000..6fe247e8 --- /dev/null +++ b/mailslurp/APIs/SentEmailsControllerAPI.swift @@ -0,0 +1,986 @@ +// +// SentEmailsControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class SentEmailsControllerAPI : NSObject { + /** + Delete all sent email receipts + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAllSentEmails(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAllSentEmailsWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all sent email receipts + - DELETE /sent + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func deleteAllSentEmailsWithRequestBuilder() -> RequestBuilder { + let path = "/sent" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete sent email receipt + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteSentEmail( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteSentEmailWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete sent email receipt + - DELETE /sent/{id} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func deleteSentEmailWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/sent/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllSentTrackingPixels: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter page: (query) Optional page index in sent email tracking pixel list pagination (optional, default to 0) + - parameter size: (query) Optional page size in sent email tracking pixel list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllSentTrackingPixels( page: Int? = nil, size: Int? = nil, sort: Sort_getAllSentTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllSentTrackingPixelsWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/tracking-pixels + - Get all sent email tracking pixels in paginated form + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in sent email tracking pixel list pagination (optional, default to 0) + - parameter size: (query) Optional page size in sent email tracking pixel list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAllSentTrackingPixelsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllSentTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sent/tracking-pixels" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get raw sent email string. Returns unparsed raw SMTP message with headers and body. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getRawSentEmailContents( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getRawSentEmailContentsWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get raw sent email string. Returns unparsed raw SMTP message with headers and body. + - GET /sent/{emailId}/raw + - Returns a raw, unparsed, and unprocessed sent email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawSentEmailJson endpoint + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func getRawSentEmailContentsWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/sent/{emailId}/raw" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format. + + - parameter emailId: (path) ID of email + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getRawSentEmailJson( emailId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getRawSentEmailJsonWithRequestBuilder(emailId: emailId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format. + - GET /sent/{emailId}/raw/json + - Returns a raw, unparsed, and unprocessed sent email wrapped in a JSON response object for easier handling when compared with the getRawSentEmail text/plain response + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter emailId: (path) ID of email + - returns: RequestBuilder + */ + open class func getRawSentEmailJsonWithRequestBuilder(emailId: UUID) -> RequestBuilder { + var path = "/sent/{emailId}/raw/json" + let emailIdPreEscape = "\(APIHelper.mapValueToPathItem(emailId))" + let emailIdPostEscape = emailIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{emailId}", with: emailIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter deliveryId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentDeliveryStatus( deliveryId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentDeliveryStatusWithRequestBuilder(deliveryId: deliveryId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/delivery-status/{deliveryId} + - Get a sent email delivery status + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter deliveryId: (path) + - returns: RequestBuilder + */ + open class func getSentDeliveryStatusWithRequestBuilder(deliveryId: UUID) -> RequestBuilder { + var path = "/sent/delivery-status/{deliveryId}" + let deliveryIdPreEscape = "\(APIHelper.mapValueToPathItem(deliveryId))" + let deliveryIdPostEscape = deliveryIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{deliveryId}", with: deliveryIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSentDeliveryStatuses: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter page: (query) Optional page index in delivery status list pagination (optional, default to 0) + - parameter size: (query) Optional page size in delivery status list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentDeliveryStatuses( page: Int? = nil, size: Int? = nil, sort: Sort_getSentDeliveryStatuses? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentDeliveryStatusesWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/delivery-status + - Get all sent email delivery statuses + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in delivery status list pagination (optional, default to 0) + - parameter size: (query) Optional page size in delivery status list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getSentDeliveryStatusesWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getSentDeliveryStatuses? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sent/delivery-status" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSentDeliveryStatusesBySentId: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter sentId: (path) + - parameter page: (query) Optional page index in delivery status list pagination (optional, default to 0) + - parameter size: (query) Optional page size in delivery status list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentDeliveryStatusesBySentId( sentId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getSentDeliveryStatusesBySentId? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentDeliveryStatusesBySentIdWithRequestBuilder(sentId: sentId, page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/{sentId}/delivery-status + - Get all sent email delivery statuses + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter sentId: (path) + - parameter page: (query) Optional page index in delivery status list pagination (optional, default to 0) + - parameter size: (query) Optional page size in delivery status list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getSentDeliveryStatusesBySentIdWithRequestBuilder(sentId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getSentDeliveryStatusesBySentId? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/sent/{sentId}/delivery-status" + let sentIdPreEscape = "\(APIHelper.mapValueToPathItem(sentId))" + let sentIdPostEscape = sentIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{sentId}", with: sentIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get sent email receipt + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentEmail( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentEmailWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get sent email receipt + - GET /sent/{id} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func getSentEmailWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/sent/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get sent email HTML content + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentEmailHTMLContent( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentEmailHTMLContentWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get sent email HTML content + - GET /sent/{id}/html + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func getSentEmailHTMLContentWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/sent/{id}/html" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get sent email URL for viewing in browser or downloading + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentEmailPreviewURLs( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentEmailPreviewURLsWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get sent email URL for viewing in browser or downloading + - GET /sent/{id}/urls + - Get a list of URLs for sent email content as text/html or raw SMTP message for viewing the message in a browser. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func getSentEmailPreviewURLsWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/sent/{id}/urls" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSentEmailTrackingPixels: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter _id: (path) + - parameter page: (query) Optional page index in sent email tracking pixel list pagination (optional, default to 0) + - parameter size: (query) Optional page size in sent email tracking pixel list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentEmailTrackingPixels( _id: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmailTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentEmailTrackingPixelsWithRequestBuilder(_id: _id, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/{id}/tracking-pixels + - Get all tracking pixels for a sent email in paginated form + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - parameter page: (query) Optional page index in sent email tracking pixel list pagination (optional, default to 0) + - parameter size: (query) Optional page size in sent email tracking pixel list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getSentEmailTrackingPixelsWithRequestBuilder(_id: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmailTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/sent/{id}/tracking-pixels" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSentEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all sent emails in paginated form + + - parameter inboxId: (query) Optional inboxId to filter sender of sent emails by (optional) + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentEmails( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentEmailsWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all sent emails in paginated form + - GET /sent + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inboxId to filter sender of sent emails by (optional) + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getSentEmailsWithRequestBuilder(inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sent" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSentEmailsWithQueueResults: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get results of email sent with queues in paginated form + + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentEmailsWithQueueResults( page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmailsWithQueueResults? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentEmailsWithQueueResultsWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get results of email sent with queues in paginated form + - GET /sent/queue-results + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in inbox sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in inbox sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getSentEmailsWithQueueResultsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getSentEmailsWithQueueResults? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sent/queue-results" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSentOrganizationEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + + - parameter inboxId: (query) Optional inboxId to filter sender of sent emails by (optional) + - parameter page: (query) Optional page index in sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSentOrganizationEmails( inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSentOrganizationEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSentOrganizationEmailsWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/organization + - Get all sent organization emails in paginated form + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Optional inboxId to filter sender of sent emails by (optional) + - parameter page: (query) Optional page index in sent email list pagination (optional, default to 0) + - parameter size: (query) Optional page size in sent email list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getSentOrganizationEmailsWithRequestBuilder(inboxId: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSentOrganizationEmails? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sent/organization" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter sentId: (query) Optional sent email ID filter (optional) + - parameter inboxId: (query) Optional inbox ID filter (optional) + - parameter timeout: (query) Optional timeout milliseconds (optional) + - parameter index: (query) Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func waitForDeliveryStatuses( sentId: UUID? = nil, inboxId: UUID? = nil, timeout: Int64? = nil, index: Int? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + waitForDeliveryStatusesWithRequestBuilder(sentId: sentId, inboxId: inboxId, timeout: timeout, index: index, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /sent/delivery-status/wait-for + - Wait for delivery statuses + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter sentId: (query) Optional sent email ID filter (optional) + - parameter inboxId: (query) Optional inbox ID filter (optional) + - parameter timeout: (query) Optional timeout milliseconds (optional) + - parameter index: (query) Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func waitForDeliveryStatusesWithRequestBuilder(sentId: UUID? = nil, inboxId: UUID? = nil, timeout: Int64? = nil, index: Int? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sent/delivery-status/wait-for" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "sentId": sentId?.encodeToJSON(), + "inboxId": inboxId?.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "index": index?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/SmsControllerAPI.swift b/mailslurp/APIs/SmsControllerAPI.swift new file mode 100644 index 00000000..6c64568a --- /dev/null +++ b/mailslurp/APIs/SmsControllerAPI.swift @@ -0,0 +1,242 @@ +// +// SmsControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class SmsControllerAPI : NSObject { + /** + Delete SMS message. + + - parameter smsId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteSmsMessage( smsId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteSmsMessageWithRequestBuilder(smsId: smsId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete SMS message. + - DELETE /sms/{smsId} + - Delete an SMS message + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter smsId: (path) + - returns: RequestBuilder + */ + open class func deleteSmsMessageWithRequestBuilder(smsId: UUID) -> RequestBuilder { + var path = "/sms/{smsId}" + let smsIdPreEscape = "\(APIHelper.mapValueToPathItem(smsId))" + let smsIdPostEscape = smsIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{smsId}", with: smsIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete all SMS messages + + - parameter phoneNumberId: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteSmsMessages( phoneNumberId: UUID? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteSmsMessagesWithRequestBuilder(phoneNumberId: phoneNumberId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all SMS messages + - DELETE /sms + - Delete all SMS messages or all messages for a given phone number + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneNumberId: (query) (optional) + - returns: RequestBuilder + */ + open class func deleteSmsMessagesWithRequestBuilder(phoneNumberId: UUID? = nil) -> RequestBuilder { + let path = "/sms" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "phoneNumberId": phoneNumberId?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. + + - parameter smsId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSmsMessage( smsId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSmsMessageWithRequestBuilder(smsId: smsId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. + - GET /sms/{smsId} + - Returns a SMS summary object with content. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter smsId: (path) + - returns: RequestBuilder + */ + open class func getSmsMessageWithRequestBuilder(smsId: UUID) -> RequestBuilder { + var path = "/sms/{smsId}" + let smsIdPreEscape = "\(APIHelper.mapValueToPathItem(smsId))" + let smsIdPostEscape = smsIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{smsId}", with: smsIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getSmsMessagesPaginated: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get all SMS messages in all phone numbers in paginated form. . + + - parameter phoneNumber: (query) Optional receiving phone number to filter SMS messages for (optional) + - parameter page: (query) Optional page index in SMS list pagination (optional, default to 0) + - parameter size: (query) Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter unreadOnly: (query) Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional, default to false) + - parameter since: (query) Optional filter SMSs received after given date time (optional) + - parameter before: (query) Optional filter SMSs received before given date time (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getSmsMessagesPaginated( phoneNumber: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSmsMessagesPaginated? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getSmsMessagesPaginatedWithRequestBuilder(phoneNumber: phoneNumber, page: page, size: size, sort: sort, unreadOnly: unreadOnly, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all SMS messages in all phone numbers in paginated form. . + - GET /sms + - By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneNumber: (query) Optional receiving phone number to filter SMS messages for (optional) + - parameter page: (query) Optional page index in SMS list pagination (optional, default to 0) + - parameter size: (query) Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter unreadOnly: (query) Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional, default to false) + - parameter since: (query) Optional filter SMSs received after given date time (optional) + - parameter before: (query) Optional filter SMSs received before given date time (optional) + - returns: RequestBuilder + */ + open class func getSmsMessagesPaginatedWithRequestBuilder(phoneNumber: UUID? = nil, page: Int? = nil, size: Int? = nil, sort: Sort_getSmsMessagesPaginated? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/sms" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "phoneNumber": phoneNumber?.encodeToJSON(), + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/TemplateControllerAPI.swift b/mailslurp/APIs/TemplateControllerAPI.swift new file mode 100644 index 00000000..76dd18d0 --- /dev/null +++ b/mailslurp/APIs/TemplateControllerAPI.swift @@ -0,0 +1,434 @@ +// +// TemplateControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class TemplateControllerAPI : NSObject { + /** + Create a Template + + - parameter createTemplateOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createTemplate( createTemplateOptions: CreateTemplateOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createTemplateWithRequestBuilder(createTemplateOptions: createTemplateOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create a Template + - POST /templates + - Create an email template with variables for use with templated transactional emails. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createTemplateOptions: (body) + - returns: RequestBuilder + */ + open class func createTemplateWithRequestBuilder(createTemplateOptions: CreateTemplateOptions) -> RequestBuilder { + let path = "/templates" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createTemplateOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete email template + + - parameter templateId: (path) Template ID + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteTemplate( templateId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteTemplateWithRequestBuilder(templateId: templateId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete email template + - DELETE /templates/{templateId} + - Delete template + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter templateId: (path) Template ID + - returns: RequestBuilder + */ + open class func deleteTemplateWithRequestBuilder(templateId: UUID) -> RequestBuilder { + var path = "/templates/{templateId}" + let templateIdPreEscape = "\(APIHelper.mapValueToPathItem(templateId))" + let templateIdPostEscape = templateIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{templateId}", with: templateIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllTemplates: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List templates + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllTemplates( page: Int? = nil, size: Int? = nil, sort: Sort_getAllTemplates? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllTemplatesWithRequestBuilder(page: page, size: size, sort: sort, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List templates + - GET /templates/paginated + - Get all templates in paginated format + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAllTemplatesWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllTemplates? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/templates/paginated" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get template + + - parameter templateId: (path) Template ID + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTemplate( templateId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTemplateWithRequestBuilder(templateId: templateId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get template + - GET /templates/{templateId} + - Get email template + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter templateId: (path) Template ID + - returns: RequestBuilder + */ + open class func getTemplateWithRequestBuilder(templateId: UUID) -> RequestBuilder { + var path = "/templates/{templateId}" + let templateIdPreEscape = "\(APIHelper.mapValueToPathItem(templateId))" + let templateIdPostEscape = templateIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{templateId}", with: templateIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get template preview HTML + + - parameter templateId: (path) Template ID + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTemplatePreviewHtml( templateId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTemplatePreviewHtmlWithRequestBuilder(templateId: templateId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get template preview HTML + - GET /templates/{templateId}/preview/html + - Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter templateId: (path) Template ID + - returns: RequestBuilder + */ + open class func getTemplatePreviewHtmlWithRequestBuilder(templateId: UUID) -> RequestBuilder { + var path = "/templates/{templateId}/preview/html" + let templateIdPreEscape = "\(APIHelper.mapValueToPathItem(templateId))" + let templateIdPostEscape = templateIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{templateId}", with: templateIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get template preview Json + + - parameter templateId: (path) Template ID + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTemplatePreviewJson( templateId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTemplatePreviewJsonWithRequestBuilder(templateId: templateId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get template preview Json + - GET /templates/{templateId}/preview/json + - Get email template preview with passed template variables in JSON format. Pass template variables as query params. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter templateId: (path) Template ID + - returns: RequestBuilder + */ + open class func getTemplatePreviewJsonWithRequestBuilder(templateId: UUID) -> RequestBuilder { + var path = "/templates/{templateId}/preview/json" + let templateIdPreEscape = "\(APIHelper.mapValueToPathItem(templateId))" + let templateIdPostEscape = templateIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{templateId}", with: templateIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + List templates + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[TemplateProjection]> + */ + open class func getTemplates(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[TemplateProjection]> { + let deferred = Promise<[TemplateProjection]>.pending() + getTemplatesWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List templates + - GET /templates + - Get all templates + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder<[TemplateProjection]> + */ + open class func getTemplatesWithRequestBuilder() -> RequestBuilder<[TemplateProjection]> { + let path = "/templates" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[TemplateProjection]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Update template + + - parameter templateId: (path) Template ID + - parameter createTemplateOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func updateTemplate( templateId: UUID, createTemplateOptions: CreateTemplateOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + updateTemplateWithRequestBuilder(templateId: templateId, createTemplateOptions: createTemplateOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Update template + - PUT /templates/{templateId} + - Update email template + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter templateId: (path) Template ID + - parameter createTemplateOptions: (body) + - returns: RequestBuilder + */ + open class func updateTemplateWithRequestBuilder(templateId: UUID, createTemplateOptions: CreateTemplateOptions) -> RequestBuilder { + var path = "/templates/{templateId}" + let templateIdPreEscape = "\(APIHelper.mapValueToPathItem(templateId))" + let templateIdPostEscape = templateIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{templateId}", with: templateIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createTemplateOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/TrackingControllerAPI.swift b/mailslurp/APIs/TrackingControllerAPI.swift new file mode 100644 index 00000000..c503a8be --- /dev/null +++ b/mailslurp/APIs/TrackingControllerAPI.swift @@ -0,0 +1,184 @@ +// +// TrackingControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class TrackingControllerAPI : NSObject { + /** + Create tracking pixel + + - parameter createTrackingPixelOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createTrackingPixel( createTrackingPixelOptions: CreateTrackingPixelOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createTrackingPixelWithRequestBuilder(createTrackingPixelOptions: createTrackingPixelOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Create tracking pixel + - POST /tracking/pixels + - Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createTrackingPixelOptions: (body) + - returns: RequestBuilder + */ + open class func createTrackingPixelWithRequestBuilder(createTrackingPixelOptions: CreateTrackingPixelOptions) -> RequestBuilder { + let path = "/tracking/pixels" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createTrackingPixelOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllTrackingPixels: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get tracking pixels + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllTrackingPixels( page: Int? = nil, size: Int? = nil, sort: Sort_getAllTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllTrackingPixelsWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get tracking pixels + - GET /tracking/pixels + - List tracking pixels in paginated form + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAllTrackingPixelsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllTrackingPixels? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/tracking/pixels" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get pixel + + - parameter _id: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTrackingPixel( _id: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTrackingPixelWithRequestBuilder(_id: _id).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get pixel + - GET /tracking/pixels/{id} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter _id: (path) + - returns: RequestBuilder + */ + open class func getTrackingPixelWithRequestBuilder(_id: UUID) -> RequestBuilder { + var path = "/tracking/pixels/{id}" + let _idPreEscape = "\(APIHelper.mapValueToPathItem(_id))" + let _idPostEscape = _idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{id}", with: _idPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/WaitForControllerAPI.swift b/mailslurp/APIs/WaitForControllerAPI.swift new file mode 100644 index 00000000..a7947feb --- /dev/null +++ b/mailslurp/APIs/WaitForControllerAPI.swift @@ -0,0 +1,554 @@ +// +// WaitForControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class WaitForControllerAPI : NSObject { + /** + Wait for an email to match the provided filter conditions such as subject contains keyword. + + - parameter waitForConditions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[EmailPreview]> + */ + open class func waitFor( waitForConditions: WaitForConditions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[EmailPreview]> { + let deferred = Promise<[EmailPreview]>.pending() + waitForWithRequestBuilder(waitForConditions: waitForConditions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for an email to match the provided filter conditions such as subject contains keyword. + - POST /waitFor + - Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter waitForConditions: (body) + - returns: RequestBuilder<[EmailPreview]> + */ + open class func waitForWithRequestBuilder(waitForConditions: WaitForConditions) -> RequestBuilder<[EmailPreview]> { + let path = "/waitFor" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: waitForConditions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[EmailPreview]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_waitForEmailCount: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs + + - parameter inboxId: (query) Id of the inbox we are fetching emails from + - parameter count: (query) Number of emails to wait for. Must be greater that 1 + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[EmailPreview]> + */ + open class func waitForEmailCount( inboxId: UUID, count: Int, timeout: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sort: Sort_waitForEmailCount? = nil, delay: Int64? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[EmailPreview]> { + let deferred = Promise<[EmailPreview]>.pending() + waitForEmailCountWithRequestBuilder(inboxId: inboxId, count: count, timeout: timeout, unreadOnly: unreadOnly, before: before, since: since, sort: sort, delay: delay).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs + - GET /waitForEmailCount + - If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Id of the inbox we are fetching emails from + - parameter count: (query) Number of emails to wait for. Must be greater that 1 + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - returns: RequestBuilder<[EmailPreview]> + */ + open class func waitForEmailCountWithRequestBuilder(inboxId: UUID, count: Int, timeout: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sort: Sort_waitForEmailCount? = nil, delay: Int64? = nil) -> RequestBuilder<[EmailPreview]> { + let path = "/waitForEmailCount" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + "count": count.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "before": before?.encodeToJSON(), + "since": since?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "delay": delay?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[EmailPreview]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_waitForLatestEmail: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Fetch inbox's latest email or if empty wait for an email to arrive + + - parameter inboxId: (query) Id of the inbox we are fetching emails from (optional) + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only. (optional, default to false) + - parameter before: (query) Filter for emails that were before after the given timestamp (optional) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func waitForLatestEmail( inboxId: UUID? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sort: Sort_waitForLatestEmail? = nil, delay: Int64? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + waitForLatestEmailWithRequestBuilder(inboxId: inboxId, timeout: timeout, unreadOnly: unreadOnly, before: before, since: since, sort: sort, delay: delay).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Fetch inbox's latest email or if empty wait for an email to arrive + - GET /waitForLatestEmail + - Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set `unreadOnly=true` or see the other receive methods such as `waitForNthEmail` or `waitForEmailCount`. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Id of the inbox we are fetching emails from (optional) + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only. (optional, default to false) + - parameter before: (query) Filter for emails that were before after the given timestamp (optional) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - returns: RequestBuilder + */ + open class func waitForLatestEmailWithRequestBuilder(inboxId: UUID? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sort: Sort_waitForLatestEmail? = nil, delay: Int64? = nil) -> RequestBuilder { + let path = "/waitForLatestEmail" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "before": before?.encodeToJSON(), + "since": since?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "delay": delay?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. + + - parameter waitForSingleSmsOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func waitForLatestSms( waitForSingleSmsOptions: WaitForSingleSmsOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + waitForLatestSmsWithRequestBuilder(waitForSingleSmsOptions: waitForSingleSmsOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. + - POST /waitForLatestSms + - Wait until a phone number meets given conditions or return immediately if already met + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter waitForSingleSmsOptions: (body) + - returns: RequestBuilder + */ + open class func waitForLatestSmsWithRequestBuilder(waitForSingleSmsOptions: WaitForSingleSmsOptions) -> RequestBuilder { + let path = "/waitForLatestSms" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: waitForSingleSmsOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_waitForMatchingEmails: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Wait or return list of emails that match simple matching patterns + + - parameter inboxId: (query) Id of the inbox we are fetching emails from + - parameter count: (query) Number of emails to wait for. Must be greater or equal to 1 + - parameter matchOptions: (body) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[EmailPreview]> + */ + open class func waitForMatchingEmails( inboxId: UUID, count: Int, matchOptions: MatchOptions, before: Date? = nil, since: Date? = nil, sort: Sort_waitForMatchingEmails? = nil, delay: Int64? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[EmailPreview]> { + let deferred = Promise<[EmailPreview]>.pending() + waitForMatchingEmailsWithRequestBuilder(inboxId: inboxId, count: count, matchOptions: matchOptions, before: before, since: since, sort: sort, delay: delay, timeout: timeout, unreadOnly: unreadOnly).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait or return list of emails that match simple matching patterns + - POST /waitForMatchingEmails + - Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Id of the inbox we are fetching emails from + - parameter count: (query) Number of emails to wait for. Must be greater or equal to 1 + - parameter matchOptions: (body) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - returns: RequestBuilder<[EmailPreview]> + */ + open class func waitForMatchingEmailsWithRequestBuilder(inboxId: UUID, count: Int, matchOptions: MatchOptions, before: Date? = nil, since: Date? = nil, sort: Sort_waitForMatchingEmails? = nil, delay: Int64? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil) -> RequestBuilder<[EmailPreview]> { + let path = "/waitForMatchingEmails" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: matchOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + "count": count.encodeToJSON(), + "before": before?.encodeToJSON(), + "since": since?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "delay": delay?.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[EmailPreview]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_waitForMatchingFirstEmail: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Wait for or return the first email that matches provided MatchOptions array + + - parameter inboxId: (query) Id of the inbox we are matching an email for + - parameter matchOptions: (body) + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func waitForMatchingFirstEmail( inboxId: UUID, matchOptions: MatchOptions, timeout: Int64? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, sort: Sort_waitForMatchingFirstEmail? = nil, delay: Int64? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + waitForMatchingFirstEmailWithRequestBuilder(inboxId: inboxId, matchOptions: matchOptions, timeout: timeout, unreadOnly: unreadOnly, since: since, before: before, sort: sort, delay: delay).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for or return the first email that matches provided MatchOptions array + - POST /waitForMatchingFirstEmail + - Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Id of the inbox we are matching an email for + - parameter matchOptions: (body) + - parameter timeout: (query) Max milliseconds to wait (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - returns: RequestBuilder + */ + open class func waitForMatchingFirstEmailWithRequestBuilder(inboxId: UUID, matchOptions: MatchOptions, timeout: Int64? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, sort: Sort_waitForMatchingFirstEmail? = nil, delay: Int64? = nil) -> RequestBuilder { + let path = "/waitForMatchingFirstEmail" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: matchOptions) + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "delay": delay?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_waitForNthEmail: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. + + - parameter inboxId: (query) Id of the inbox you are fetching emails from (optional) + - parameter index: (query) Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional, default to 0) + - parameter timeout: (query) Max milliseconds to wait for the nth email if not already present (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func waitForNthEmail( inboxId: UUID? = nil, index: Int? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, sort: Sort_waitForNthEmail? = nil, delay: Int64? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + waitForNthEmailWithRequestBuilder(inboxId: inboxId, index: index, timeout: timeout, unreadOnly: unreadOnly, since: since, before: before, sort: sort, delay: delay).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. + - GET /waitForNthEmail + - If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (query) Id of the inbox you are fetching emails from (optional) + - parameter index: (query) Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional, default to 0) + - parameter timeout: (query) Max milliseconds to wait for the nth email if not already present (optional) + - parameter unreadOnly: (query) Optional filter for unread only (optional, default to false) + - parameter since: (query) Filter for emails that were received after the given timestamp (optional) + - parameter before: (query) Filter for emails that were received before the given timestamp (optional) + - parameter sort: (query) Sort direction (optional) + - parameter delay: (query) Max milliseconds delay between calls (optional) + - returns: RequestBuilder + */ + open class func waitForNthEmailWithRequestBuilder(inboxId: UUID? = nil, index: Int? = nil, timeout: Int64? = nil, unreadOnly: Bool? = nil, since: Date? = nil, before: Date? = nil, sort: Sort_waitForNthEmail? = nil, delay: Int64? = nil) -> RequestBuilder { + let path = "/waitForNthEmail" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "inboxId": inboxId?.encodeToJSON(), + "index": index?.encodeToJSON(), + "timeout": timeout?.encodeToJSON(), + "unreadOnly": unreadOnly?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "delay": delay?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Wait for an SMS message to match the provided filter conditions such as body contains keyword. + + - parameter waitForSmsConditions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[SmsPreview]> + */ + open class func waitForSms( waitForSmsConditions: WaitForSmsConditions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[SmsPreview]> { + let deferred = Promise<[SmsPreview]>.pending() + waitForSmsWithRequestBuilder(waitForSmsConditions: waitForSmsConditions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Wait for an SMS message to match the provided filter conditions such as body contains keyword. + - POST /waitForSms + - Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter waitForSmsConditions: (body) + - returns: RequestBuilder<[SmsPreview]> + */ + open class func waitForSmsWithRequestBuilder(waitForSmsConditions: WaitForSmsConditions) -> RequestBuilder<[SmsPreview]> { + let path = "/waitForSms" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: waitForSmsConditions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[SmsPreview]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/APIs/WebhookControllerAPI.swift b/mailslurp/APIs/WebhookControllerAPI.swift new file mode 100644 index 00000000..1a1a35d9 --- /dev/null +++ b/mailslurp/APIs/WebhookControllerAPI.swift @@ -0,0 +1,1563 @@ +// +// WebhookControllerAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import PromiseKit + +@objc open class WebhookControllerAPI : NSObject { + /** + Attach a WebHook URL to an inbox + + - parameter createWebhookOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createAccountWebhook( createWebhookOptions: CreateWebhookOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createAccountWebhookWithRequestBuilder(createWebhookOptions: createWebhookOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Attach a WebHook URL to an inbox + - POST /webhooks + - Get notified of account level events such as bounce and bounce recipient. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter createWebhookOptions: (body) + - returns: RequestBuilder + */ + open class func createAccountWebhookWithRequestBuilder(createWebhookOptions: CreateWebhookOptions) -> RequestBuilder { + let path = "/webhooks" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createWebhookOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Attach a WebHook URL to an inbox + + - parameter inboxId: (path) + - parameter createWebhookOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createWebhook( inboxId: UUID, createWebhookOptions: CreateWebhookOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createWebhookWithRequestBuilder(inboxId: inboxId, createWebhookOptions: createWebhookOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Attach a WebHook URL to an inbox + - POST /inboxes/{inboxId}/webhooks + - Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter createWebhookOptions: (body) + - returns: RequestBuilder + */ + open class func createWebhookWithRequestBuilder(inboxId: UUID, createWebhookOptions: CreateWebhookOptions) -> RequestBuilder { + var path = "/inboxes/{inboxId}/webhooks" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createWebhookOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Attach a WebHook URL to a phone number + + - parameter phoneNumberId: (path) + - parameter createWebhookOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func createWebhookForPhoneNumber( phoneNumberId: UUID, createWebhookOptions: CreateWebhookOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + createWebhookForPhoneNumberWithRequestBuilder(phoneNumberId: phoneNumberId, createWebhookOptions: createWebhookOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Attach a WebHook URL to a phone number + - POST /phone/numbers/{phoneNumberId}/webhooks + - Get notified whenever a phone number receives an SMS via a WebHook URL. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter phoneNumberId: (path) + - parameter createWebhookOptions: (body) + - returns: RequestBuilder + */ + open class func createWebhookForPhoneNumberWithRequestBuilder(phoneNumberId: UUID, createWebhookOptions: CreateWebhookOptions) -> RequestBuilder { + var path = "/phone/numbers/{phoneNumberId}/webhooks" + let phoneNumberIdPreEscape = "\(APIHelper.mapValueToPathItem(phoneNumberId))" + let phoneNumberIdPostEscape = phoneNumberIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{phoneNumberId}", with: phoneNumberIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createWebhookOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete all webhooks + + - parameter before: (query) before (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteAllWebhooks( before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteAllWebhooksWithRequestBuilder(before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete all webhooks + - DELETE /webhooks + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter before: (query) before (optional) + - returns: RequestBuilder + */ + open class func deleteAllWebhooksWithRequestBuilder(before: Date? = nil) -> RequestBuilder { + let path = "/webhooks" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete and disable a Webhook for an Inbox + + - parameter inboxId: (path) + - parameter webhookId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteWebhook( inboxId: UUID, webhookId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteWebhookWithRequestBuilder(inboxId: inboxId, webhookId: webhookId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete and disable a Webhook for an Inbox + - DELETE /inboxes/{inboxId}/webhooks/{webhookId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter webhookId: (path) + - returns: RequestBuilder + */ + open class func deleteWebhookWithRequestBuilder(inboxId: UUID, webhookId: UUID) -> RequestBuilder { + var path = "/inboxes/{inboxId}/webhooks/{webhookId}" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Delete a webhook + + - parameter webhookId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func deleteWebhookById( webhookId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + deleteWebhookByIdWithRequestBuilder(webhookId: webhookId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + deferred.resolver.fulfill(()) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Delete a webhook + - DELETE /webhooks/{webhookId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) + - returns: RequestBuilder + */ + open class func deleteWebhookByIdWithRequestBuilder(webhookId: UUID) -> RequestBuilder { + var path = "/webhooks/{webhookId}" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllWebhookResults: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get results for all webhooks + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter unseenOnly: (query) Filter for unseen exceptions only (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllWebhookResults( page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhookResults? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, unseenOnly: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllWebhookResultsWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, unseenOnly: unseenOnly).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get results for all webhooks + - GET /webhooks/results + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter unseenOnly: (query) Filter for unseen exceptions only (optional) + - returns: RequestBuilder + */ + open class func getAllWebhookResultsWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhookResults? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, unseenOnly: Bool? = nil) -> RequestBuilder { + let path = "/webhooks/results" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "unseenOnly": unseenOnly?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getAllWebhooks: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + List Webhooks Paginated + + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size for paginated result list. (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .desc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getAllWebhooks( page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhooks? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getAllWebhooksWithRequestBuilder(page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + List Webhooks Paginated + - GET /webhooks/paginated + - List webhooks in paginated form. Allows for page index, page size, and sort direction. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size for paginated result list. (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .desc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getAllWebhooksWithRequestBuilder(page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhooks? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + let path = "/webhooks/paginated" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getInboxWebhooksPaginated: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get paginated webhooks for an Inbox + + - parameter inboxId: (path) + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getInboxWebhooksPaginated( inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxWebhooksPaginated? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getInboxWebhooksPaginatedWithRequestBuilder(inboxId: inboxId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get paginated webhooks for an Inbox + - GET /inboxes/{inboxId}/webhooks/paginated + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - returns: RequestBuilder + */ + open class func getInboxWebhooksPaginatedWithRequestBuilder(inboxId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getInboxWebhooksPaginated? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil) -> RequestBuilder { + var path = "/inboxes/{inboxId}/webhooks/paginated" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter event + */ + public enum Event_getJsonSchemaForWebhookEvent: String, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + + /** + + - parameter event: (query) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getJsonSchemaForWebhookEvent( event: Event_getJsonSchemaForWebhookEvent, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getJsonSchemaForWebhookEventWithRequestBuilder(event: event).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - POST /webhooks/schema + - Get JSON Schema definition for webhook payload by event + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter event: (query) + - returns: RequestBuilder + */ + open class func getJsonSchemaForWebhookEventWithRequestBuilder(event: Event_getJsonSchemaForWebhookEvent) -> RequestBuilder { + let path = "/webhooks/schema" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "event": event.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter webhookId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getJsonSchemaForWebhookPayload( webhookId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getJsonSchemaForWebhookPayloadWithRequestBuilder(webhookId: webhookId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - POST /webhooks/{webhookId}/schema + - Get JSON Schema definition for webhook payload + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) + - returns: RequestBuilder + */ + open class func getJsonSchemaForWebhookPayloadWithRequestBuilder(webhookId: UUID) -> RequestBuilder { + var path = "/webhooks/{webhookId}/schema" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter eventName + */ + public enum EventName_getTestWebhookPayload: String, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + + /** + + - parameter eventName: (query) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayload( eventName: EventName_getTestWebhookPayload? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadWithRequestBuilder(eventName: eventName).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /webhooks/test + - Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter eventName: (query) (optional) + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadWithRequestBuilder(eventName: EventName_getTestWebhookPayload? = nil) -> RequestBuilder { + let path = "/webhooks/test" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "eventName": eventName?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadBounce(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadBounceWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /webhooks/test/email-bounce-payload + - Get webhook test payload for bounce + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadBounceWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/email-bounce-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadBounceRecipient(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadBounceRecipientWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /webhooks/test/email-bounce-recipient-payload + - Get webhook test payload for bounce recipient + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadBounceRecipientWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/email-bounce-recipient-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadEmailOpened(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadEmailOpenedWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /webhooks/test/email-opened-payload + - Get webhook test payload for email opened event + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadEmailOpenedWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/email-opened-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadEmailRead(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadEmailReadWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - GET /webhooks/test/email-read-payload + - Get webhook test payload for email opened event + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadEmailReadWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/email-read-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + + - parameter webhookId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadForWebhook( webhookId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadForWebhookWithRequestBuilder(webhookId: webhookId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + - POST /webhooks/{webhookId}/example + - Get example payload for webhook + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadForWebhookWithRequestBuilder(webhookId: UUID) -> RequestBuilder { + var path = "/webhooks/{webhookId}/example" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get webhook test payload for new attachment event + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadNewAttachment(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadNewAttachmentWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get webhook test payload for new attachment event + - GET /webhooks/test/new-attachment-payload + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadNewAttachmentWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/new-attachment-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get webhook test payload for new contact event + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadNewContact(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadNewContactWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get webhook test payload for new contact event + - GET /webhooks/test/new-contact-payload + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadNewContactWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/new-contact-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get webhook test payload for new email event + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getTestWebhookPayloadNewEmail(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getTestWebhookPayloadNewEmailWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get webhook test payload for new email event + - GET /webhooks/test/new-email-payload + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getTestWebhookPayloadNewEmailWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/test/new-email-payload" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get a webhook + + - parameter webhookId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getWebhook( webhookId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getWebhookWithRequestBuilder(webhookId: webhookId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a webhook + - GET /webhooks/{webhookId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) + - returns: RequestBuilder + */ + open class func getWebhookWithRequestBuilder(webhookId: UUID) -> RequestBuilder { + var path = "/webhooks/{webhookId}" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get a webhook result for a webhook + + - parameter webhookResultId: (path) Webhook Result ID + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getWebhookResult( webhookResultId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getWebhookResultWithRequestBuilder(webhookResultId: webhookResultId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a webhook result for a webhook + - GET /webhooks/results/{webhookResultId} + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookResultId: (path) Webhook Result ID + - returns: RequestBuilder + */ + open class func getWebhookResultWithRequestBuilder(webhookResultId: UUID) -> RequestBuilder { + var path = "/webhooks/results/{webhookResultId}" + let webhookResultIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookResultId))" + let webhookResultIdPostEscape = webhookResultIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookResultId}", with: webhookResultIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + * enum for parameter sort + */ + public enum Sort_getWebhookResults: String, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + + /** + Get a webhook results for a webhook + + - parameter webhookId: (path) ID of webhook to get results for + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter unseenOnly: (query) Filter for unseen exceptions only (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getWebhookResults( webhookId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getWebhookResults? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, unseenOnly: Bool? = nil, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getWebhookResultsWithRequestBuilder(webhookId: webhookId, page: page, size: size, sort: sort, searchFilter: searchFilter, since: since, before: before, unseenOnly: unseenOnly).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a webhook results for a webhook + - GET /webhooks/{webhookId}/results + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) ID of webhook to get results for + - parameter page: (query) Optional page index in list pagination (optional, default to 0) + - parameter size: (query) Optional page size in list pagination (optional, default to 20) + - parameter sort: (query) Optional createdAt sort direction ASC or DESC (optional, default to .asc) + - parameter searchFilter: (query) Optional search filter (optional) + - parameter since: (query) Filter by created at after the given timestamp (optional) + - parameter before: (query) Filter by created at before the given timestamp (optional) + - parameter unseenOnly: (query) Filter for unseen exceptions only (optional) + - returns: RequestBuilder + */ + open class func getWebhookResultsWithRequestBuilder(webhookId: UUID, page: Int? = nil, size: Int? = nil, sort: Sort_getWebhookResults? = nil, searchFilter: String? = nil, since: Date? = nil, before: Date? = nil, unseenOnly: Bool? = nil) -> RequestBuilder { + var path = "/webhooks/{webhookId}/results" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + var urlComponents = URLComponents(string: URLString) + urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "page": page?.encodeToJSON(), + "size": size?.encodeToJSON(), + "sort": sort?.encodeToJSON(), + "searchFilter": searchFilter?.encodeToJSON(), + "since": since?.encodeToJSON(), + "before": before?.encodeToJSON(), + "unseenOnly": unseenOnly?.encodeToJSON(), + ]) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get count of unseen webhook results with error status + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func getWebhookResultsUnseenErrorCount(apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + getWebhookResultsUnseenErrorCountWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get count of unseen webhook results with error status + - GET /webhooks/results/unseen-count + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - returns: RequestBuilder + */ + open class func getWebhookResultsUnseenErrorCountWithRequestBuilder() -> RequestBuilder { + let path = "/webhooks/results/unseen-count" + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get all webhooks for an Inbox + + - parameter inboxId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise<[WebhookDto]> + */ + open class func getWebhooks( inboxId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise<[WebhookDto]> { + let deferred = Promise<[WebhookDto]>.pending() + getWebhooksWithRequestBuilder(inboxId: inboxId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get all webhooks for an Inbox + - GET /inboxes/{inboxId}/webhooks + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter inboxId: (path) + - returns: RequestBuilder<[WebhookDto]> + */ + open class func getWebhooksWithRequestBuilder(inboxId: UUID) -> RequestBuilder<[WebhookDto]> { + var path = "/inboxes/{inboxId}/webhooks" + let inboxIdPreEscape = "\(APIHelper.mapValueToPathItem(inboxId))" + let inboxIdPostEscape = inboxIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{inboxId}", with: inboxIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder<[WebhookDto]>.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Get a webhook result and try to resend the original webhook payload + + - parameter webhookResultId: (path) Webhook Result ID + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func redriveWebhookResult( webhookResultId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + redriveWebhookResultWithRequestBuilder(webhookResultId: webhookResultId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Get a webhook result and try to resend the original webhook payload + - POST /webhooks/results/{webhookResultId}/redrive + - Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookResultId: (path) Webhook Result ID + - returns: RequestBuilder + */ + open class func redriveWebhookResultWithRequestBuilder(webhookResultId: UUID) -> RequestBuilder { + var path = "/webhooks/results/{webhookResultId}/redrive" + let webhookResultIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookResultId))" + let webhookResultIdPostEscape = webhookResultIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookResultId}", with: webhookResultIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Send webhook test data + + - parameter webhookId: (path) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func sendTestData( webhookId: UUID, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + sendTestDataWithRequestBuilder(webhookId: webhookId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Send webhook test data + - POST /webhooks/{webhookId}/test + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) + - returns: RequestBuilder + */ + open class func sendTestDataWithRequestBuilder(webhookId: UUID) -> RequestBuilder { + var path = "/webhooks/{webhookId}/test" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters: [String: Any]? = nil + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Update a webhook request headers + + - parameter webhookId: (path) + - parameter webhookHeaders: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func updateWebhookHeaders( webhookId: UUID, webhookHeaders: WebhookHeaders, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + updateWebhookHeadersWithRequestBuilder(webhookId: webhookId, webhookHeaders: webhookHeaders).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Update a webhook request headers + - PUT /webhooks/{webhookId}/headers + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter webhookId: (path) + - parameter webhookHeaders: (body) + - returns: RequestBuilder + */ + open class func updateWebhookHeadersWithRequestBuilder(webhookId: UUID, webhookHeaders: WebhookHeaders) -> RequestBuilder { + var path = "/webhooks/{webhookId}/headers" + let webhookIdPreEscape = "\(APIHelper.mapValueToPathItem(webhookId))" + let webhookIdPostEscape = webhookIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{webhookId}", with: webhookIdPostEscape, options: .literal, range: nil) + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: webhookHeaders) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + + /** + Verify a webhook payload signature + + - parameter verifyWebhookSignatureOptions: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - returns: Promise + */ + open class func verifyWebhookSignature( verifyWebhookSignatureOptions: VerifyWebhookSignatureOptions, apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue) -> Promise { + let deferred = Promise.pending() + verifyWebhookSignatureWithRequestBuilder(verifyWebhookSignatureOptions: verifyWebhookSignatureOptions).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + deferred.resolver.fulfill(response.body!) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } + + /** + Verify a webhook payload signature + - POST /webhooks/verify + - Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server. + - API Key: + - type: apiKey x-api-key + - name: API_KEY + - parameter verifyWebhookSignatureOptions: (body) + - returns: RequestBuilder + */ + open class func verifyWebhookSignatureWithRequestBuilder(verifyWebhookSignatureOptions: VerifyWebhookSignatureOptions) -> RequestBuilder { + let path = "/webhooks/verify" + let URLString = mailslurpAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: verifyWebhookSignatureOptions) + + let urlComponents = URLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + : + ] + + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = mailslurpAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters) + } + +} diff --git a/mailslurp/CodableHelper.swift b/mailslurp/CodableHelper.swift new file mode 100644 index 00000000..09c82e53 --- /dev/null +++ b/mailslurp/CodableHelper.swift @@ -0,0 +1,49 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class CodableHelper { + private static var customDateFormatter: DateFormatter? + private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() + + private static var customJSONDecoder: JSONDecoder? + private static var defaultJSONDecoder: JSONDecoder = { + let decoder = JSONDecoder() + decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) + return decoder + }() + + private static var customJSONEncoder: JSONEncoder? + private static var defaultJSONEncoder: JSONEncoder = { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) + encoder.outputFormatting = .prettyPrinted + return encoder + }() + + public static var dateFormatter: DateFormatter { + get { return customDateFormatter ?? defaultDateFormatter } + set { customDateFormatter = newValue } + } + public static var jsonDecoder: JSONDecoder { + get { return customJSONDecoder ?? defaultJSONDecoder } + set { customJSONDecoder = newValue } + } + public static var jsonEncoder: JSONEncoder { + get { return customJSONEncoder ?? defaultJSONEncoder } + set { customJSONEncoder = newValue } + } + + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try jsonDecoder.decode(type, from: data) } + } + + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try jsonEncoder.encode(value) } + } +} diff --git a/mailslurp/Configuration.swift b/mailslurp/Configuration.swift new file mode 100644 index 00000000..18edabbe --- /dev/null +++ b/mailslurp/Configuration.swift @@ -0,0 +1,14 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") + public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" +} diff --git a/mailslurp/Extensions.swift b/mailslurp/Extensions.swift new file mode 100644 index 00000000..78d15ab2 --- /dev/null +++ b/mailslurp/Extensions.swift @@ -0,0 +1,243 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable +import PromiseKit + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension RawRepresentable where RawValue: JSONEncodable { + func encodeToJSON() -> Any { return self.rawValue as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Set: JSONEncodable { + func encodeToJSON() -> Any { + return Array(self).encodeToJSON() + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return CodableHelper.dateFormatter.string(from: self) as Any + } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { + return self + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + +extension HTTPURLResponse { + var isStatusCodeSuccessful: Bool { + return Array(200 ..< 300).contains(statusCode) + } +} + +extension RequestBuilder { + public func execute() -> Promise> { + let deferred = Promise>.pending() + self.execute { result in + switch result { + case let .success(response): + deferred.resolver.fulfill(response) + case let .failure(error): + deferred.resolver.reject(error) + } + } + return deferred.promise + } +} + +extension AnyCodable: Hashable { + public func hash(into hasher: inout Hasher) { + switch value { + case let value as Bool: + hasher.combine(value) + case let value as Int: + hasher.combine(value) + case let value as Int8: + hasher.combine(value) + case let value as Int16: + hasher.combine(value) + case let value as Int32: + hasher.combine(value) + case let value as Int64: + hasher.combine(value) + case let value as UInt: + hasher.combine(value) + case let value as UInt8: + hasher.combine(value) + case let value as UInt16: + hasher.combine(value) + case let value as UInt32: + hasher.combine(value) + case let value as UInt64: + hasher.combine(value) + case let value as Float: + hasher.combine(value) + case let value as Double: + hasher.combine(value) + case let value as String: + hasher.combine(value) + case let value as [String: AnyCodable]: + hasher.combine(value) + case let value as [AnyCodable]: + hasher.combine(value) + default: + hasher.combine(0) + } + } +} \ No newline at end of file diff --git a/mailslurp/JSONDataEncoding.swift b/mailslurp/JSONDataEncoding.swift new file mode 100644 index 00000000..b79e9f5e --- /dev/null +++ b/mailslurp/JSONDataEncoding.swift @@ -0,0 +1,53 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct JSONDataEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { + var urlRequest = urlRequest + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> [String: Any]? { + var returnedParams: [String: Any]? + if let jsonData = jsonData, !jsonData.isEmpty { + var params: [String: Any] = [:] + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/mailslurp/JSONEncodingHelper.swift b/mailslurp/JSONEncodingHelper.swift new file mode 100644 index 00000000..02f78ffb --- /dev/null +++ b/mailslurp/JSONEncodingHelper.swift @@ -0,0 +1,45 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj) + do { + let data = try encodeResult.get() + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { + var params: [String: Any]? + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + return nil + } + } + + return params + } + +} diff --git a/mailslurp/Models.swift b/mailslurp/Models.swift new file mode 100644 index 00000000..96e26a20 --- /dev/null +++ b/mailslurp/Models.swift @@ -0,0 +1,54 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse: Error { + case error(Int, Data?, URLResponse?, Error) +} + +public enum DownloadException: Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum DecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case unsuccessfulHTTPStatusCode + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class Response { + public let statusCode: Int + public let header: [String: String] + public let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String: String]() + for (key, value) in rawHeader { + if let key = key.base as? String, let value = value as? String { + header[key] = value + } + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/mailslurp/Models/AbstractWebhookPayload.swift b/mailslurp/Models/AbstractWebhookPayload.swift new file mode 100644 index 00000000..22efa27b --- /dev/null +++ b/mailslurp/Models/AbstractWebhookPayload.swift @@ -0,0 +1,55 @@ +// +// AbstractWebhookPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Abstract webhook payload. Use the correct payload type for your webhook event type in order to access all the specific properties for that event. See the `NEW_EMAIL`,`NEW_CONTACT`, `NEW_ATTACHMENT` and `EMAIL_OPENED` payloads for the properties available for those events. */ +@objc public class AbstractWebhookPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + public var eventName: EventName + public var messageId: String + public var webhookId: UUID + public var webhookName: String? + + public init(eventName: EventName, messageId: String, webhookId: UUID, webhookName: String? = nil) { + self.eventName = eventName + self.messageId = messageId + self.webhookId = webhookId + self.webhookName = webhookName + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case eventName + case messageId + case webhookId + case webhookName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(eventName, forKey: .eventName) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + } + + + +} diff --git a/mailslurp/Models/AliasDto.swift b/mailslurp/Models/AliasDto.swift new file mode 100644 index 00000000..6f1644e8 --- /dev/null +++ b/mailslurp/Models/AliasDto.swift @@ -0,0 +1,78 @@ +// +// AliasDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email alias representation */ +@objc public class AliasDto: NSObject, Codable { + + public var _id: UUID + /** The alias's email address for receiving email */ + public var emailAddress: String + /** The underlying email address that is hidden and will received forwarded email */ + public var maskedEmailAddress: String? + public var userId: UUID + /** Inbox that is associated with the alias */ + public var inboxId: UUID + public var name: String? + /** If alias will generate response threads or not when email are received by it */ + public var useThreads: Bool? + public var useThreadsNum: NSNumber? { + get { + return useThreads as NSNumber? + } + } + /** Has the alias been verified. You must verify an alias if the masked email address has not yet been verified by your account */ + public var isVerified: Bool + public var createdAt: Date? + public var updatedAt: Date? + + public init(_id: UUID, emailAddress: String, maskedEmailAddress: String? = nil, userId: UUID, inboxId: UUID, name: String? = nil, useThreads: Bool? = nil, isVerified: Bool, createdAt: Date? = nil, updatedAt: Date? = nil) { + self._id = _id + self.emailAddress = emailAddress + self.maskedEmailAddress = maskedEmailAddress + self.userId = userId + self.inboxId = inboxId + self.name = name + self.useThreads = useThreads + self.isVerified = isVerified + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case emailAddress + case maskedEmailAddress + case userId + case inboxId + case name + case useThreads + case isVerified + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(maskedEmailAddress, forKey: .maskedEmailAddress) + try container.encode(userId, forKey: .userId) + try container.encode(inboxId, forKey: .inboxId) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(useThreads, forKey: .useThreads) + try container.encode(isVerified, forKey: .isVerified) + try container.encodeIfPresent(createdAt, forKey: .createdAt) + try container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/AliasProjection.swift b/mailslurp/Models/AliasProjection.swift new file mode 100644 index 00000000..a1be1b68 --- /dev/null +++ b/mailslurp/Models/AliasProjection.swift @@ -0,0 +1,65 @@ +// +// AliasProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Representation of a alias */ +@objc public class AliasProjection: NSObject, Codable { + + public var name: String? + public var _id: UUID + public var inboxId: UUID + public var userId: UUID + public var emailAddress: String + public var createdAt: Date + public var updatedAt: Date + public var useThreads: Bool? + public var useThreadsNum: NSNumber? { + get { + return useThreads as NSNumber? + } + } + + public init(name: String? = nil, _id: UUID, inboxId: UUID, userId: UUID, emailAddress: String, createdAt: Date, updatedAt: Date, useThreads: Bool? = nil) { + self.name = name + self._id = _id + self.inboxId = inboxId + self.userId = userId + self.emailAddress = emailAddress + self.createdAt = createdAt + self.updatedAt = updatedAt + self.useThreads = useThreads + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _id = "id" + case inboxId + case userId + case emailAddress + case createdAt + case updatedAt + case useThreads + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encode(_id, forKey: ._id) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(userId, forKey: .userId) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encodeIfPresent(useThreads, forKey: .useThreads) + } + + + +} diff --git a/mailslurp/Models/AttachmentEntity.swift b/mailslurp/Models/AttachmentEntity.swift new file mode 100644 index 00000000..4de33921 --- /dev/null +++ b/mailslurp/Models/AttachmentEntity.swift @@ -0,0 +1,69 @@ +// +// AttachmentEntity.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email attachment entity */ +@objc public class AttachmentEntity: NSObject, Codable { + + public var _id: UUID? + public var attachmentId: String + public var bucket: String? + public var userId: UUID + public var contentType: String? + public var contentLength: Int64? + public var contentLengthNum: NSNumber? { + get { + return contentLength as NSNumber? + } + } + public var name: String? + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID? = nil, attachmentId: String, bucket: String? = nil, userId: UUID, contentType: String? = nil, contentLength: Int64? = nil, name: String? = nil, createdAt: Date, updatedAt: Date) { + self._id = _id + self.attachmentId = attachmentId + self.bucket = bucket + self.userId = userId + self.contentType = contentType + self.contentLength = contentLength + self.name = name + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case attachmentId + case bucket + case userId + case contentType + case contentLength + case name + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encode(attachmentId, forKey: .attachmentId) + try container.encodeIfPresent(bucket, forKey: .bucket) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(contentType, forKey: .contentType) + try container.encodeIfPresent(contentLength, forKey: .contentLength) + try container.encodeIfPresent(name, forKey: .name) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/AttachmentMetaData.swift b/mailslurp/Models/AttachmentMetaData.swift new file mode 100644 index 00000000..1242cc67 --- /dev/null +++ b/mailslurp/Models/AttachmentMetaData.swift @@ -0,0 +1,48 @@ +// +// AttachmentMetaData.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Meta data associated with an attachment. Attachments are stored as byte blobs so the meta data is stored separately. */ +@objc public class AttachmentMetaData: NSObject, Codable { + + /** Name of attachment if given */ + public var name: String + /** Content type of attachment such as `image/png` */ + public var contentType: String + /** Size of attachment in bytes */ + public var contentLength: Int64 + /** ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email. */ + public var _id: String + + public init(name: String, contentType: String, contentLength: Int64, _id: String) { + self.name = name + self.contentType = contentType + self.contentLength = contentLength + self._id = _id + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case contentType + case contentLength + case _id = "id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(contentType, forKey: .contentType) + try container.encode(contentLength, forKey: .contentLength) + try container.encode(_id, forKey: ._id) + } + + + +} diff --git a/mailslurp/Models/AttachmentProjection.swift b/mailslurp/Models/AttachmentProjection.swift new file mode 100644 index 00000000..91be5ce9 --- /dev/null +++ b/mailslurp/Models/AttachmentProjection.swift @@ -0,0 +1,64 @@ +// +// AttachmentProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email attachment data */ +@objc public class AttachmentProjection: NSObject, Codable { + + public var name: String? + /** Content length of attachment in bytes */ + public var contentLength: Int64? + public var contentLengthNum: NSNumber? { + get { + return contentLength as NSNumber? + } + } + /** Content type of attachment. */ + public var contentType: String? + public var userId: UUID + /** Attachment ID */ + public var attachmentId: String + public var createdAt: Date + public var updatedAt: Date + + public init(name: String? = nil, contentLength: Int64? = nil, contentType: String? = nil, userId: UUID, attachmentId: String, createdAt: Date, updatedAt: Date) { + self.name = name + self.contentLength = contentLength + self.contentType = contentType + self.userId = userId + self.attachmentId = attachmentId + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case contentLength + case contentType + case userId + case attachmentId + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(contentLength, forKey: .contentLength) + try container.encodeIfPresent(contentType, forKey: .contentType) + try container.encode(userId, forKey: .userId) + try container.encode(attachmentId, forKey: .attachmentId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/BasicAuthOptions.swift b/mailslurp/Models/BasicAuthOptions.swift new file mode 100644 index 00000000..28e58b98 --- /dev/null +++ b/mailslurp/Models/BasicAuthOptions.swift @@ -0,0 +1,36 @@ +// +// BasicAuthOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Basic Authentication options for webhooks. Will be used is present when calling webhook endpoints. */ +@objc public class BasicAuthOptions: NSObject, Codable { + + public var username: String + public var password: String + + public init(username: String, password: String) { + self.username = username + self.password = password + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case username + case password + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(username, forKey: .username) + try container.encode(password, forKey: .password) + } + + + +} diff --git a/mailslurp/Models/BounceProjection.swift b/mailslurp/Models/BounceProjection.swift new file mode 100644 index 00000000..a8303327 --- /dev/null +++ b/mailslurp/Models/BounceProjection.swift @@ -0,0 +1,52 @@ +// +// BounceProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Bounced email event */ +@objc public class BounceProjection: NSObject, Codable { + + public var _id: UUID? + public var sender: String + public var subject: String? + public var createdAt: Date + public var bounceMta: String? + public var bounceType: String? + + public init(_id: UUID? = nil, sender: String, subject: String? = nil, createdAt: Date, bounceMta: String? = nil, bounceType: String? = nil) { + self._id = _id + self.sender = sender + self.subject = subject + self.createdAt = createdAt + self.bounceMta = bounceMta + self.bounceType = bounceType + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case sender + case subject + case createdAt + case bounceMta + case bounceType + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encode(sender, forKey: .sender) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(createdAt, forKey: .createdAt) + try container.encodeIfPresent(bounceMta, forKey: .bounceMta) + try container.encodeIfPresent(bounceType, forKey: .bounceType) + } + + + +} diff --git a/mailslurp/Models/BounceRecipientProjection.swift b/mailslurp/Models/BounceRecipientProjection.swift new file mode 100644 index 00000000..d3953235 --- /dev/null +++ b/mailslurp/Models/BounceRecipientProjection.swift @@ -0,0 +1,52 @@ +// +// BounceRecipientProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Bounced recipient */ +@objc public class BounceRecipientProjection: NSObject, Codable { + + public var _id: UUID? + public var action: String? + public var status: String? + public var sentEmailId: UUID? + public var createdAt: Date + public var recipient: String + + public init(_id: UUID? = nil, action: String? = nil, status: String? = nil, sentEmailId: UUID? = nil, createdAt: Date, recipient: String) { + self._id = _id + self.action = action + self.status = status + self.sentEmailId = sentEmailId + self.createdAt = createdAt + self.recipient = recipient + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case action + case status + case sentEmailId + case createdAt + case recipient + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encodeIfPresent(action, forKey: .action) + try container.encodeIfPresent(status, forKey: .status) + try container.encodeIfPresent(sentEmailId, forKey: .sentEmailId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(recipient, forKey: .recipient) + } + + + +} diff --git a/mailslurp/Models/BouncedEmailDto.swift b/mailslurp/Models/BouncedEmailDto.swift new file mode 100644 index 00000000..ad165a2b --- /dev/null +++ b/mailslurp/Models/BouncedEmailDto.swift @@ -0,0 +1,76 @@ +// +// BouncedEmailDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Bounced email */ +@objc public class BouncedEmailDto: NSObject, Codable { + + public var _id: UUID? + public var userId: UUID + public var notificationType: String + public var sentToRecipients: [String]? + public var sender: String + public var bounceMta: String? + public var bounceType: String? + public var bounceRecipients: [String]? + public var bounceSubType: String? + public var sentEmailId: UUID? + public var subject: String? + public var createdAt: Date + + public init(_id: UUID? = nil, userId: UUID, notificationType: String, sentToRecipients: [String]? = nil, sender: String, bounceMta: String? = nil, bounceType: String? = nil, bounceRecipients: [String]? = nil, bounceSubType: String? = nil, sentEmailId: UUID? = nil, subject: String? = nil, createdAt: Date) { + self._id = _id + self.userId = userId + self.notificationType = notificationType + self.sentToRecipients = sentToRecipients + self.sender = sender + self.bounceMta = bounceMta + self.bounceType = bounceType + self.bounceRecipients = bounceRecipients + self.bounceSubType = bounceSubType + self.sentEmailId = sentEmailId + self.subject = subject + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case notificationType + case sentToRecipients + case sender + case bounceMta + case bounceType + case bounceRecipients + case bounceSubType + case sentEmailId + case subject + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(notificationType, forKey: .notificationType) + try container.encodeIfPresent(sentToRecipients, forKey: .sentToRecipients) + try container.encode(sender, forKey: .sender) + try container.encodeIfPresent(bounceMta, forKey: .bounceMta) + try container.encodeIfPresent(bounceType, forKey: .bounceType) + try container.encodeIfPresent(bounceRecipients, forKey: .bounceRecipients) + try container.encodeIfPresent(bounceSubType, forKey: .bounceSubType) + try container.encodeIfPresent(sentEmailId, forKey: .sentEmailId) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/BouncedRecipientDto.swift b/mailslurp/Models/BouncedRecipientDto.swift new file mode 100644 index 00000000..30acee6f --- /dev/null +++ b/mailslurp/Models/BouncedRecipientDto.swift @@ -0,0 +1,60 @@ +// +// BouncedRecipientDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Bounced recipient */ +@objc public class BouncedRecipientDto: NSObject, Codable { + + public var _id: UUID? + public var userId: UUID? + public var sentEmailId: UUID? + public var recipient: String + public var diagnosticCode: String? + public var action: String? + public var status: String? + public var createdAt: Date + + public init(_id: UUID? = nil, userId: UUID? = nil, sentEmailId: UUID? = nil, recipient: String, diagnosticCode: String? = nil, action: String? = nil, status: String? = nil, createdAt: Date) { + self._id = _id + self.userId = userId + self.sentEmailId = sentEmailId + self.recipient = recipient + self.diagnosticCode = diagnosticCode + self.action = action + self.status = status + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case sentEmailId + case recipient + case diagnosticCode + case action + case status + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encodeIfPresent(userId, forKey: .userId) + try container.encodeIfPresent(sentEmailId, forKey: .sentEmailId) + try container.encode(recipient, forKey: .recipient) + try container.encodeIfPresent(diagnosticCode, forKey: .diagnosticCode) + try container.encodeIfPresent(action, forKey: .action) + try container.encodeIfPresent(status, forKey: .status) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/BulkSendEmailOptions.swift b/mailslurp/Models/BulkSendEmailOptions.swift new file mode 100644 index 00000000..b41d4225 --- /dev/null +++ b/mailslurp/Models/BulkSendEmailOptions.swift @@ -0,0 +1,37 @@ +// +// BulkSendEmailOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for bulk sending an email from multiple addresses. See regular `sendEmail` methods for more information. */ +@objc public class BulkSendEmailOptions: NSObject, Codable { + + /** Inboxes to send the email from */ + public var inboxIds: [UUID] + public var sendEmailOptions: SendEmailOptions + + public init(inboxIds: [UUID], sendEmailOptions: SendEmailOptions) { + self.inboxIds = inboxIds + self.sendEmailOptions = sendEmailOptions + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxIds + case sendEmailOptions + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(inboxIds, forKey: .inboxIds) + try container.encode(sendEmailOptions, forKey: .sendEmailOptions) + } + + + +} diff --git a/mailslurp/Models/Complaint.swift b/mailslurp/Models/Complaint.swift new file mode 100644 index 00000000..5c96d622 --- /dev/null +++ b/mailslurp/Models/Complaint.swift @@ -0,0 +1,59 @@ +// +// Complaint.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class Complaint: NSObject, Codable { + + public var _id: UUID + public var userId: UUID? + public var eventType: String? + public var mailSource: String? + public var mailMessageId: String? + public var complaintRecipient: String + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID, userId: UUID? = nil, eventType: String? = nil, mailSource: String? = nil, mailMessageId: String? = nil, complaintRecipient: String, createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.eventType = eventType + self.mailSource = mailSource + self.mailMessageId = mailMessageId + self.complaintRecipient = complaintRecipient + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case eventType + case mailSource + case mailMessageId + case complaintRecipient + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(userId, forKey: .userId) + try container.encodeIfPresent(eventType, forKey: .eventType) + try container.encodeIfPresent(mailSource, forKey: .mailSource) + try container.encodeIfPresent(mailMessageId, forKey: .mailMessageId) + try container.encode(complaintRecipient, forKey: .complaintRecipient) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/ConditionOption.swift b/mailslurp/Models/ConditionOption.swift new file mode 100644 index 00000000..7090265a --- /dev/null +++ b/mailslurp/Models/ConditionOption.swift @@ -0,0 +1,45 @@ +// +// ConditionOption.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for matching emails in an inbox based on a condition such as `HAS_ATTACHMENTS=TRUE` */ +@objc public class ConditionOption: NSObject, Codable { + + public enum Condition: String, Codable, CaseIterable { + case hasAttachments = "HAS_ATTACHMENTS" + } + public enum Value: String, Codable, CaseIterable { + case _true = "TRUE" + case _false = "FALSE" + } + /** Condition of an email object that can be used to filter results */ + public var condition: Condition + /** Expected condition value */ + public var value: Value + + public init(condition: Condition, value: Value) { + self.condition = condition + self.value = value + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case condition + case value + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(condition, forKey: .condition) + try container.encode(value, forKey: .value) + } + + + +} diff --git a/mailslurp/Models/ContactDto.swift b/mailslurp/Models/ContactDto.swift new file mode 100644 index 00000000..34314b94 --- /dev/null +++ b/mailslurp/Models/ContactDto.swift @@ -0,0 +1,77 @@ +// +// ContactDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Contact object. For saving a user in contact book. */ +@objc public class ContactDto: NSObject, Codable { + + public var _id: UUID + public var groupId: UUID? + public var firstName: String? + public var lastName: String? + public var company: String? + public var emailAddresses: [String] + public var primaryEmailAddress: String? + public var tags: [String] + public var metaData: AnyCodable? + public var optOut: Bool? + public var optOutNum: NSNumber? { + get { + return optOut as NSNumber? + } + } + public var createdAt: Date + + public init(_id: UUID, groupId: UUID? = nil, firstName: String? = nil, lastName: String? = nil, company: String? = nil, emailAddresses: [String], primaryEmailAddress: String? = nil, tags: [String], metaData: AnyCodable? = nil, optOut: Bool? = nil, createdAt: Date) { + self._id = _id + self.groupId = groupId + self.firstName = firstName + self.lastName = lastName + self.company = company + self.emailAddresses = emailAddresses + self.primaryEmailAddress = primaryEmailAddress + self.tags = tags + self.metaData = metaData + self.optOut = optOut + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case groupId + case firstName + case lastName + case company + case emailAddresses + case primaryEmailAddress + case tags + case metaData + case optOut + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(groupId, forKey: .groupId) + try container.encodeIfPresent(firstName, forKey: .firstName) + try container.encodeIfPresent(lastName, forKey: .lastName) + try container.encodeIfPresent(company, forKey: .company) + try container.encode(emailAddresses, forKey: .emailAddresses) + try container.encodeIfPresent(primaryEmailAddress, forKey: .primaryEmailAddress) + try container.encode(tags, forKey: .tags) + try container.encodeIfPresent(metaData, forKey: .metaData) + try container.encodeIfPresent(optOut, forKey: .optOut) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/ContactProjection.swift b/mailslurp/Models/ContactProjection.swift new file mode 100644 index 00000000..96658f3d --- /dev/null +++ b/mailslurp/Models/ContactProjection.swift @@ -0,0 +1,60 @@ +// +// ContactProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email contact for address book */ +@objc public class ContactProjection: NSObject, Codable { + + public var _id: UUID + public var groupId: UUID? + public var createdAt: Date + public var lastName: String? + public var company: String? + public var emailAddresses: [String]? + public var optOut: Bool + public var firstName: String? + + public init(_id: UUID, groupId: UUID? = nil, createdAt: Date, lastName: String? = nil, company: String? = nil, emailAddresses: [String]? = nil, optOut: Bool, firstName: String? = nil) { + self._id = _id + self.groupId = groupId + self.createdAt = createdAt + self.lastName = lastName + self.company = company + self.emailAddresses = emailAddresses + self.optOut = optOut + self.firstName = firstName + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case groupId + case createdAt + case lastName + case company + case emailAddresses + case optOut + case firstName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(groupId, forKey: .groupId) + try container.encode(createdAt, forKey: .createdAt) + try container.encodeIfPresent(lastName, forKey: .lastName) + try container.encodeIfPresent(company, forKey: .company) + try container.encodeIfPresent(emailAddresses, forKey: .emailAddresses) + try container.encode(optOut, forKey: .optOut) + try container.encodeIfPresent(firstName, forKey: .firstName) + } + + + +} diff --git a/mailslurp/Models/ContentMatchOptions.swift b/mailslurp/Models/ContentMatchOptions.swift new file mode 100644 index 00000000..0b50b9bf --- /dev/null +++ b/mailslurp/Models/ContentMatchOptions.swift @@ -0,0 +1,33 @@ +// +// ContentMatchOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for matching content using regex patterns based on Java Pattern syntax */ +@objc public class ContentMatchOptions: NSObject, Codable { + + /** Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns. */ + public var pattern: String + + public init(pattern: String) { + self.pattern = pattern + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case pattern + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(pattern, forKey: .pattern) + } + + + +} diff --git a/mailslurp/Models/CountDto.swift b/mailslurp/Models/CountDto.swift new file mode 100644 index 00000000..afa23ced --- /dev/null +++ b/mailslurp/Models/CountDto.swift @@ -0,0 +1,32 @@ +// +// CountDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Number of elements */ +@objc public class CountDto: NSObject, Codable { + + public var totalElements: Int64 + + public init(totalElements: Int64) { + self.totalElements = totalElements + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case totalElements + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(totalElements, forKey: .totalElements) + } + + + +} diff --git a/mailslurp/Models/CreateAliasOptions.swift b/mailslurp/Models/CreateAliasOptions.swift new file mode 100644 index 00000000..219dc9bf --- /dev/null +++ b/mailslurp/Models/CreateAliasOptions.swift @@ -0,0 +1,48 @@ +// +// CreateAliasOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Create email alias options. Email aliases can be used to mask real email addresses behind an ID. You can also attach an inbox to an alias so that any email received by the inbox email address if forwarded to the alias email address. */ +@objc public class CreateAliasOptions: NSObject, Codable { + + /** Email address to be hidden behind alias. Emails sent to the alias email address will be forwarded to this address. If you want to enable replies set useThreads true and the reply-to for the email will allow outbound communication via a thread. */ + public var emailAddress: String + /** Optional inbox ID to attach to alias. Null by default means an a new inbox will be created for the alias. Use a custom inbox to control what email address the alias uses. To use custom email addresses create a domain and an inbox, the use the inbox ID with this call. Emails received by this inbox will be forwarded to the alias email address */ + public var inboxId: UUID? + /** Optional name for alias */ + public var name: String? + /** Enable threads options. If true emails will be sent with a unique reply-to thread address. This means you can reply to the forwarded email and it will be sent to the recipients via your alias address. That way a thread conversation is preserved. */ + public var useThreads: Bool + + public init(emailAddress: String, inboxId: UUID? = nil, name: String? = nil, useThreads: Bool) { + self.emailAddress = emailAddress + self.inboxId = inboxId + self.name = name + self.useThreads = useThreads + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case emailAddress + case inboxId + case name + case useThreads + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encodeIfPresent(name, forKey: .name) + try container.encode(useThreads, forKey: .useThreads) + } + + + +} diff --git a/mailslurp/Models/CreateContactOptions.swift b/mailslurp/Models/CreateContactOptions.swift new file mode 100644 index 00000000..69e6edfe --- /dev/null +++ b/mailslurp/Models/CreateContactOptions.swift @@ -0,0 +1,69 @@ +// +// CreateContactOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating an email contact in address book */ +@objc public class CreateContactOptions: NSObject, Codable { + + public var firstName: String? + public var lastName: String? + public var company: String? + /** Set of email addresses belonging to the contact */ + public var emailAddresses: [String]? + /** Tags that can be used to search and group contacts */ + public var tags: [String]? + public var metaData: AnyCodable? + /** Has the user explicitly or implicitly opted out of being contacted? If so MailSlurp will ignore them in all actions. */ + public var optOut: Bool? + public var optOutNum: NSNumber? { + get { + return optOut as NSNumber? + } + } + /** Group IDs that contact belongs to */ + public var groupId: UUID? + + public init(firstName: String? = nil, lastName: String? = nil, company: String? = nil, emailAddresses: [String]? = nil, tags: [String]? = nil, metaData: AnyCodable? = nil, optOut: Bool? = nil, groupId: UUID? = nil) { + self.firstName = firstName + self.lastName = lastName + self.company = company + self.emailAddresses = emailAddresses + self.tags = tags + self.metaData = metaData + self.optOut = optOut + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case firstName + case lastName + case company + case emailAddresses + case tags + case metaData + case optOut + case groupId + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(firstName, forKey: .firstName) + try container.encodeIfPresent(lastName, forKey: .lastName) + try container.encodeIfPresent(company, forKey: .company) + try container.encodeIfPresent(emailAddresses, forKey: .emailAddresses) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encodeIfPresent(metaData, forKey: .metaData) + try container.encodeIfPresent(optOut, forKey: .optOut) + try container.encodeIfPresent(groupId, forKey: .groupId) + } + + + +} diff --git a/mailslurp/Models/CreateDomainOptions.swift b/mailslurp/Models/CreateDomainOptions.swift new file mode 100644 index 00000000..af3300ff --- /dev/null +++ b/mailslurp/Models/CreateDomainOptions.swift @@ -0,0 +1,57 @@ +// +// CreateDomainOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not function correctly until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help. Domains can be either `HTTP` or `SMTP` type. The type of domain determines which inboxes can be used with it. `SMTP` inboxes use a mail server running `mx.mailslurp.com` while `HTTP` inboxes are handled by AWS SES. */ +@objc public class CreateDomainOptions: NSObject, Codable { + + public enum DomainType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpDomain = "SMTP_DOMAIN" + } + /** The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain. */ + public var domain: String + /** Optional description of the domain. */ + public var _description: String? + /** Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID. */ + public var createdCatchAllInbox: Bool? + public var createdCatchAllInboxNum: NSNumber? { + get { + return createdCatchAllInbox as NSNumber? + } + } + /** Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails. */ + public var domainType: DomainType? + + public init(domain: String, _description: String? = nil, createdCatchAllInbox: Bool? = nil, domainType: DomainType? = nil) { + self.domain = domain + self._description = _description + self.createdCatchAllInbox = createdCatchAllInbox + self.domainType = domainType + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case domain + case _description = "description" + case createdCatchAllInbox + case domainType + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(domain, forKey: .domain) + try container.encodeIfPresent(_description, forKey: ._description) + try container.encodeIfPresent(createdCatchAllInbox, forKey: .createdCatchAllInbox) + try container.encodeIfPresent(domainType, forKey: .domainType) + } + + + +} diff --git a/mailslurp/Models/CreateEmergencyAddressOptions.swift b/mailslurp/Models/CreateEmergencyAddressOptions.swift new file mode 100644 index 00000000..8b1d7212 --- /dev/null +++ b/mailslurp/Models/CreateEmergencyAddressOptions.swift @@ -0,0 +1,59 @@ +// +// CreateEmergencyAddressOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class CreateEmergencyAddressOptions: NSObject, Codable { + + public enum IsoCountryCode: String, Codable, CaseIterable { + case us = "US" + case gb = "GB" + } + public var customerName: String + public var address1: String + public var city: String + public var region: String + public var postalCode: String + public var isoCountryCode: IsoCountryCode + public var displayName: String? + + public init(customerName: String, address1: String, city: String, region: String, postalCode: String, isoCountryCode: IsoCountryCode, displayName: String? = nil) { + self.customerName = customerName + self.address1 = address1 + self.city = city + self.region = region + self.postalCode = postalCode + self.isoCountryCode = isoCountryCode + self.displayName = displayName + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case customerName + case address1 + case city + case region + case postalCode + case isoCountryCode + case displayName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(customerName, forKey: .customerName) + try container.encode(address1, forKey: .address1) + try container.encode(city, forKey: .city) + try container.encode(region, forKey: .region) + try container.encode(postalCode, forKey: .postalCode) + try container.encode(isoCountryCode, forKey: .isoCountryCode) + try container.encodeIfPresent(displayName, forKey: .displayName) + } + + + +} diff --git a/mailslurp/Models/CreateGroupOptions.swift b/mailslurp/Models/CreateGroupOptions.swift new file mode 100644 index 00000000..ab8f838d --- /dev/null +++ b/mailslurp/Models/CreateGroupOptions.swift @@ -0,0 +1,36 @@ +// +// CreateGroupOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Create contact group options */ +@objc public class CreateGroupOptions: NSObject, Codable { + + public var name: String + public var _description: String? + + public init(name: String, _description: String? = nil) { + self.name = name + self._description = _description + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _description = "description" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encodeIfPresent(_description, forKey: ._description) + } + + + +} diff --git a/mailslurp/Models/CreateInboxDto.swift b/mailslurp/Models/CreateInboxDto.swift new file mode 100644 index 00000000..81a22ccf --- /dev/null +++ b/mailslurp/Models/CreateInboxDto.swift @@ -0,0 +1,112 @@ +// +// CreateInboxDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating an inbox. An inbox has a real email address that can send and receive emails. Inboxes can be permanent or expire at a given time. Inboxes are either `SMTP` or `HTTP` mailboxes. `SMTP` inboxes are processed by a mail server running at `mx.mailslurp.com` while `HTTP` inboxes are processed by AWS SES. Inboxes can use a custom email address (by verifying your own domain) or a randomly assigned email ending in either `mailslurp.com` or (if `useDomainPool` is enabled) ending in a similar domain such as `mailslurp.xyz` (selected at random). */ +@objc public class CreateInboxDto: NSObject, Codable { + + public enum InboxType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + /** A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. */ + public var emailAddress: String? + /** Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. */ + public var name: String? + /** Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with */ + public var _description: String? + /** Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. */ + public var useDomainPool: Bool? + public var useDomainPoolNum: NSNumber? { + get { + return useDomainPool as NSNumber? + } + } + /** Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. */ + public var tags: [String]? + /** Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. */ + public var expiresAt: Date? + /** Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering */ + public var favourite: Bool? + public var favouriteNum: NSNumber? { + get { + return favourite as NSNumber? + } + } + /** Number of milliseconds that inbox should exist for */ + public var expiresIn: Int64? + public var expiresInNum: NSNumber? { + get { + return expiresIn as NSNumber? + } + } + /** DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. */ + public var allowTeamAccess: Bool? + public var allowTeamAccessNum: NSNumber? { + get { + return allowTeamAccess as NSNumber? + } + } + /** Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). */ + public var inboxType: InboxType? + /** Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. */ + public var virtualInbox: Bool? + public var virtualInboxNum: NSNumber? { + get { + return virtualInbox as NSNumber? + } + } + + public init(emailAddress: String? = nil, name: String? = nil, _description: String? = nil, useDomainPool: Bool? = nil, tags: [String]? = nil, expiresAt: Date? = nil, favourite: Bool? = nil, expiresIn: Int64? = nil, allowTeamAccess: Bool? = nil, inboxType: InboxType? = nil, virtualInbox: Bool? = nil) { + self.emailAddress = emailAddress + self.name = name + self._description = _description + self.useDomainPool = useDomainPool + self.tags = tags + self.expiresAt = expiresAt + self.favourite = favourite + self.expiresIn = expiresIn + self.allowTeamAccess = allowTeamAccess + self.inboxType = inboxType + self.virtualInbox = virtualInbox + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case emailAddress + case name + case _description = "description" + case useDomainPool + case tags + case expiresAt + case favourite + case expiresIn + case allowTeamAccess + case inboxType + case virtualInbox + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(_description, forKey: ._description) + try container.encodeIfPresent(useDomainPool, forKey: .useDomainPool) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encodeIfPresent(expiresAt, forKey: .expiresAt) + try container.encodeIfPresent(favourite, forKey: .favourite) + try container.encodeIfPresent(expiresIn, forKey: .expiresIn) + try container.encodeIfPresent(allowTeamAccess, forKey: .allowTeamAccess) + try container.encodeIfPresent(inboxType, forKey: .inboxType) + try container.encodeIfPresent(virtualInbox, forKey: .virtualInbox) + } + + + +} diff --git a/mailslurp/Models/CreateInboxForwarderOptions.swift b/mailslurp/Models/CreateInboxForwarderOptions.swift new file mode 100644 index 00000000..0520d757 --- /dev/null +++ b/mailslurp/Models/CreateInboxForwarderOptions.swift @@ -0,0 +1,49 @@ +// +// CreateInboxForwarderOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating an inbox forwarder */ +@objc public class CreateInboxForwarderOptions: NSObject, Codable { + + public enum Field: String, Codable, CaseIterable { + case recipients = "RECIPIENTS" + case sender = "SENDER" + case subject = "SUBJECT" + case attachments = "ATTACHMENTS" + } + /** Field to match against to trigger inbox forwarding for inbound email */ + public var field: Field + /** String or wildcard style match for field specified when evaluating forwarding rules */ + public var match: String + /** Email addresses to forward an email to if it matches the field and match criteria of the forwarder */ + public var forwardToRecipients: [String] + + public init(field: Field, match: String, forwardToRecipients: [String]) { + self.field = field + self.match = match + self.forwardToRecipients = forwardToRecipients + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case field + case match + case forwardToRecipients + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(field, forKey: .field) + try container.encode(match, forKey: .match) + try container.encode(forwardToRecipients, forKey: .forwardToRecipients) + } + + + +} diff --git a/mailslurp/Models/CreateInboxRulesetOptions.swift b/mailslurp/Models/CreateInboxRulesetOptions.swift new file mode 100644 index 00000000..7e8f9110 --- /dev/null +++ b/mailslurp/Models/CreateInboxRulesetOptions.swift @@ -0,0 +1,52 @@ +// +// CreateInboxRulesetOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, filter, or forward emails when sending or receiving using the inbox. */ +@objc public class CreateInboxRulesetOptions: NSObject, Codable { + + public enum Scope: String, Codable, CaseIterable { + case receivingEmails = "RECEIVING_EMAILS" + case sendingEmails = "SENDING_EMAILS" + } + public enum Action: String, Codable, CaseIterable { + case block = "BLOCK" + case allow = "ALLOW" + case filterRemove = "FILTER_REMOVE" + } + /** What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively. */ + public var scope: Scope + /** Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action. */ + public var action: Action + /** Target to match emails with. Can be a wild-card type pattern or a valid email address. For instance `*@gmail.com` matches all gmail addresses while `test@gmail.com` matches one address exactly. The target is applied to every recipient field email address when `SENDING_EMAILS` is the scope and is applied to sender of email when `RECEIVING_EMAILS`. */ + public var target: String + + public init(scope: Scope, action: Action, target: String) { + self.scope = scope + self.action = action + self.target = target + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case scope + case action + case target + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(scope, forKey: .scope) + try container.encode(action, forKey: .action) + try container.encode(target, forKey: .target) + } + + + +} diff --git a/mailslurp/Models/CreateTemplateOptions.swift b/mailslurp/Models/CreateTemplateOptions.swift new file mode 100644 index 00000000..50f8379f --- /dev/null +++ b/mailslurp/Models/CreateTemplateOptions.swift @@ -0,0 +1,38 @@ +// +// CreateTemplateOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Create template options */ +@objc public class CreateTemplateOptions: NSObject, Codable { + + /** Name of template */ + public var name: String + /** Template content. Can include moustache style variables such as {{var_name}} */ + public var content: String + + public init(name: String, content: String) { + self.name = name + self.content = content + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case content + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(content, forKey: .content) + } + + + +} diff --git a/mailslurp/Models/CreateTrackingPixelOptions.swift b/mailslurp/Models/CreateTrackingPixelOptions.swift new file mode 100644 index 00000000..ae342a1a --- /dev/null +++ b/mailslurp/Models/CreateTrackingPixelOptions.swift @@ -0,0 +1,36 @@ +// +// CreateTrackingPixelOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating a tracking pixel for email open tracking */ +@objc public class CreateTrackingPixelOptions: NSObject, Codable { + + public var name: String? + public var recipient: String? + + public init(name: String? = nil, recipient: String? = nil) { + self.name = name + self.recipient = recipient + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case recipient + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(recipient, forKey: .recipient) + } + + + +} diff --git a/mailslurp/Models/CreateWebhookOptions.swift b/mailslurp/Models/CreateWebhookOptions.swift new file mode 100644 index 00000000..48659ad6 --- /dev/null +++ b/mailslurp/Models/CreateWebhookOptions.swift @@ -0,0 +1,62 @@ +// +// CreateWebhookOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale. */ +@objc public class CreateWebhookOptions: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation. */ + public var url: String + public var basicAuth: BasicAuthOptions? + /** Optional name for the webhook */ + public var name: String? + /** Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. */ + public var eventName: EventName? + public var includeHeaders: WebhookHeaders? + + public init(url: String, basicAuth: BasicAuthOptions? = nil, name: String? = nil, eventName: EventName? = nil, includeHeaders: WebhookHeaders? = nil) { + self.url = url + self.basicAuth = basicAuth + self.name = name + self.eventName = eventName + self.includeHeaders = includeHeaders + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case url + case basicAuth + case name + case eventName + case includeHeaders + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(url, forKey: .url) + try container.encodeIfPresent(basicAuth, forKey: .basicAuth) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(eventName, forKey: .eventName) + try container.encodeIfPresent(includeHeaders, forKey: .includeHeaders) + } + + + +} diff --git a/mailslurp/Models/DNSLookupOptions.swift b/mailslurp/Models/DNSLookupOptions.swift new file mode 100644 index 00000000..83a09e6e --- /dev/null +++ b/mailslurp/Models/DNSLookupOptions.swift @@ -0,0 +1,134 @@ +// +// DNSLookupOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for DNS query. */ +@objc public class DNSLookupOptions: NSObject, Codable { + + public enum RecordTypes: String, Codable, CaseIterable { + case a = "A" + case ns = "NS" + case md = "MD" + case mf = "MF" + case cname = "CNAME" + case soa = "SOA" + case mb = "MB" + case mg = "MG" + case mr = "MR" + case null = "NULL" + case wks = "WKS" + case ptr = "PTR" + case hinfo = "HINFO" + case minfo = "MINFO" + case mx = "MX" + case txt = "TXT" + case rp = "RP" + case afsdb = "AFSDB" + case x25 = "X25" + case isdn = "ISDN" + case rt = "RT" + case nsap = "NSAP" + case nsapPtr = "NSAP_PTR" + case sig = "SIG" + case key = "KEY" + case px = "PX" + case gpos = "GPOS" + case aaaa = "AAAA" + case loc = "LOC" + case nxt = "NXT" + case eid = "EID" + case nimloc = "NIMLOC" + case srv = "SRV" + case atma = "ATMA" + case naptr = "NAPTR" + case kx = "KX" + case cert = "CERT" + case a6 = "A6" + case dname = "DNAME" + case sink = "SINK" + case opt = "OPT" + case apl = "APL" + case ds = "DS" + case sshfp = "SSHFP" + case ipseckey = "IPSECKEY" + case rrsig = "RRSIG" + case nsec = "NSEC" + case dnskey = "DNSKEY" + case dhcid = "DHCID" + case nsec3 = "NSEC3" + case nsec3param = "NSEC3PARAM" + case tlsa = "TLSA" + case smimea = "SMIMEA" + case hip = "HIP" + case ninfo = "NINFO" + case rkey = "RKEY" + case talink = "TALINK" + case cds = "CDS" + case cdnskey = "CDNSKEY" + case openpgpkey = "OPENPGPKEY" + case csync = "CSYNC" + case zonemd = "ZONEMD" + case svcb = "SVCB" + case https = "HTTPS" + case spf = "SPF" + case uinfo = "UINFO" + case uid = "UID" + case gid = "GID" + case unspec = "UNSPEC" + case nid = "NID" + case l32 = "L32" + case l64 = "L64" + case lp = "LP" + case eui48 = "EUI48" + case eui64 = "EUI64" + case tkey = "TKEY" + case tsig = "TSIG" + case ixfr = "IXFR" + case axfr = "AXFR" + case mailb = "MAILB" + case maila = "MAILA" + case any = "ANY" + case uri = "URI" + case caa = "CAA" + case avc = "AVC" + case doa = "DOA" + case amtrelay = "AMTRELAY" + case ta = "TA" + case dlv = "DLV" + } + /** List of record types you wish to query such as MX, DNS, TXT, NS, A etc. */ + public var hostname: String + /** List of record types you wish to query such as MX, DNS, TXT, NS, A etc. */ + public var recordTypes: [RecordTypes] + /** Optionally control whether to omit the final dot in full DNS name values. */ + public var omitFinalDNSDot: Bool + + public init(hostname: String, recordTypes: [RecordTypes], omitFinalDNSDot: Bool) { + self.hostname = hostname + self.recordTypes = recordTypes + self.omitFinalDNSDot = omitFinalDNSDot + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case hostname + case recordTypes + case omitFinalDNSDot + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(hostname, forKey: .hostname) + try container.encode(recordTypes, forKey: .recordTypes) + try container.encode(omitFinalDNSDot, forKey: .omitFinalDNSDot) + } + + + +} diff --git a/mailslurp/Models/DNSLookupResult.swift b/mailslurp/Models/DNSLookupResult.swift new file mode 100644 index 00000000..d705abb7 --- /dev/null +++ b/mailslurp/Models/DNSLookupResult.swift @@ -0,0 +1,136 @@ +// +// DNSLookupResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** DNS lookup result. Includes record type, time to live, raw response, and name value for the name server response. */ +@objc public class DNSLookupResult: NSObject, Codable { + + public enum RecordType: String, Codable, CaseIterable { + case a = "A" + case ns = "NS" + case md = "MD" + case mf = "MF" + case cname = "CNAME" + case soa = "SOA" + case mb = "MB" + case mg = "MG" + case mr = "MR" + case null = "NULL" + case wks = "WKS" + case ptr = "PTR" + case hinfo = "HINFO" + case minfo = "MINFO" + case mx = "MX" + case txt = "TXT" + case rp = "RP" + case afsdb = "AFSDB" + case x25 = "X25" + case isdn = "ISDN" + case rt = "RT" + case nsap = "NSAP" + case nsapPtr = "NSAP_PTR" + case sig = "SIG" + case key = "KEY" + case px = "PX" + case gpos = "GPOS" + case aaaa = "AAAA" + case loc = "LOC" + case nxt = "NXT" + case eid = "EID" + case nimloc = "NIMLOC" + case srv = "SRV" + case atma = "ATMA" + case naptr = "NAPTR" + case kx = "KX" + case cert = "CERT" + case a6 = "A6" + case dname = "DNAME" + case sink = "SINK" + case opt = "OPT" + case apl = "APL" + case ds = "DS" + case sshfp = "SSHFP" + case ipseckey = "IPSECKEY" + case rrsig = "RRSIG" + case nsec = "NSEC" + case dnskey = "DNSKEY" + case dhcid = "DHCID" + case nsec3 = "NSEC3" + case nsec3param = "NSEC3PARAM" + case tlsa = "TLSA" + case smimea = "SMIMEA" + case hip = "HIP" + case ninfo = "NINFO" + case rkey = "RKEY" + case talink = "TALINK" + case cds = "CDS" + case cdnskey = "CDNSKEY" + case openpgpkey = "OPENPGPKEY" + case csync = "CSYNC" + case zonemd = "ZONEMD" + case svcb = "SVCB" + case https = "HTTPS" + case spf = "SPF" + case uinfo = "UINFO" + case uid = "UID" + case gid = "GID" + case unspec = "UNSPEC" + case nid = "NID" + case l32 = "L32" + case l64 = "L64" + case lp = "LP" + case eui48 = "EUI48" + case eui64 = "EUI64" + case tkey = "TKEY" + case tsig = "TSIG" + case ixfr = "IXFR" + case axfr = "AXFR" + case mailb = "MAILB" + case maila = "MAILA" + case any = "ANY" + case uri = "URI" + case caa = "CAA" + case avc = "AVC" + case doa = "DOA" + case amtrelay = "AMTRELAY" + case ta = "TA" + case dlv = "DLV" + } + /** Domain Name Server Record Types */ + public var recordType: RecordType + public var ttl: Int64 + public var recordEntries: [String] + public var name: String + + public init(recordType: RecordType, ttl: Int64, recordEntries: [String], name: String) { + self.recordType = recordType + self.ttl = ttl + self.recordEntries = recordEntries + self.name = name + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case recordType + case ttl + case recordEntries + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(recordType, forKey: .recordType) + try container.encode(ttl, forKey: .ttl) + try container.encode(recordEntries, forKey: .recordEntries) + try container.encode(name, forKey: .name) + } + + + +} diff --git a/mailslurp/Models/DNSLookupResults.swift b/mailslurp/Models/DNSLookupResults.swift new file mode 100644 index 00000000..1a438900 --- /dev/null +++ b/mailslurp/Models/DNSLookupResults.swift @@ -0,0 +1,32 @@ +// +// DNSLookupResults.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Results of query on domain name servers */ +@objc public class DNSLookupResults: NSObject, Codable { + + public var results: [DNSLookupResult] + + public init(results: [DNSLookupResult]) { + self.results = results + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case results + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(results, forKey: .results) + } + + + +} diff --git a/mailslurp/Models/DeliveryStatusDto.swift b/mailslurp/Models/DeliveryStatusDto.swift new file mode 100644 index 00000000..aead9033 --- /dev/null +++ b/mailslurp/Models/DeliveryStatusDto.swift @@ -0,0 +1,93 @@ +// +// DeliveryStatusDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class DeliveryStatusDto: NSObject, Codable { + + public var _id: UUID + public var userId: UUID + public var sentId: UUID? + public var remoteMtaIp: String? + public var inboxId: UUID? + public var reportingMta: String? + public var recipients: [String]? + public var smtpResponse: String? + public var smtpStatusCode: Int? + public var smtpStatusCodeNum: NSNumber? { + get { + return smtpStatusCode as NSNumber? + } + } + public var processingTimeMillis: Int64? + public var processingTimeMillisNum: NSNumber? { + get { + return processingTimeMillis as NSNumber? + } + } + public var received: Date? + public var subject: String? + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID, userId: UUID, sentId: UUID? = nil, remoteMtaIp: String? = nil, inboxId: UUID? = nil, reportingMta: String? = nil, recipients: [String]? = nil, smtpResponse: String? = nil, smtpStatusCode: Int? = nil, processingTimeMillis: Int64? = nil, received: Date? = nil, subject: String? = nil, createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.sentId = sentId + self.remoteMtaIp = remoteMtaIp + self.inboxId = inboxId + self.reportingMta = reportingMta + self.recipients = recipients + self.smtpResponse = smtpResponse + self.smtpStatusCode = smtpStatusCode + self.processingTimeMillis = processingTimeMillis + self.received = received + self.subject = subject + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case sentId + case remoteMtaIp + case inboxId + case reportingMta + case recipients + case smtpResponse + case smtpStatusCode + case processingTimeMillis + case received + case subject + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(sentId, forKey: .sentId) + try container.encodeIfPresent(remoteMtaIp, forKey: .remoteMtaIp) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encodeIfPresent(reportingMta, forKey: .reportingMta) + try container.encodeIfPresent(recipients, forKey: .recipients) + try container.encodeIfPresent(smtpResponse, forKey: .smtpResponse) + try container.encodeIfPresent(smtpStatusCode, forKey: .smtpStatusCode) + try container.encodeIfPresent(processingTimeMillis, forKey: .processingTimeMillis) + try container.encodeIfPresent(received, forKey: .received) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/DescribeDomainOptions.swift b/mailslurp/Models/DescribeDomainOptions.swift new file mode 100644 index 00000000..feade32b --- /dev/null +++ b/mailslurp/Models/DescribeDomainOptions.swift @@ -0,0 +1,32 @@ +// +// DescribeDomainOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Domain record description */ +@objc public class DescribeDomainOptions: NSObject, Codable { + + public var domain: String + + public init(domain: String) { + self.domain = domain + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case domain + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(domain, forKey: .domain) + } + + + +} diff --git a/mailslurp/Models/DescribeMailServerDomainResult.swift b/mailslurp/Models/DescribeMailServerDomainResult.swift new file mode 100644 index 00000000..73b305bb --- /dev/null +++ b/mailslurp/Models/DescribeMailServerDomainResult.swift @@ -0,0 +1,40 @@ +// +// DescribeMailServerDomainResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Name Server lookup result */ +@objc public class DescribeMailServerDomainResult: NSObject, Codable { + + public var mxRecords: [NameServerRecord] + public var domain: String + public var message: String? + + public init(mxRecords: [NameServerRecord], domain: String, message: String? = nil) { + self.mxRecords = mxRecords + self.domain = domain + self.message = message + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case mxRecords + case domain + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(mxRecords, forKey: .mxRecords) + try container.encode(domain, forKey: .domain) + try container.encodeIfPresent(message, forKey: .message) + } + + + +} diff --git a/mailslurp/Models/DomainDto.swift b/mailslurp/Models/DomainDto.swift new file mode 100644 index 00000000..4e391729 --- /dev/null +++ b/mailslurp/Models/DomainDto.swift @@ -0,0 +1,83 @@ +// +// DomainDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Domain plus verification records and status */ +@objc public class DomainDto: NSObject, Codable { + + public enum DomainType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpDomain = "SMTP_DOMAIN" + } + public var _id: UUID + public var userId: UUID + /** Custom domain name */ + public var domain: String + /** Verification tokens */ + public var verificationToken: String + /** Unique token DKIM tokens */ + public var dkimTokens: [String] + /** Whether domain has been verified or not. If the domain is not verified after 72 hours there is most likely an issue with the domains DNS records. */ + public var isVerified: Bool + /** List of DNS domain name records (C, MX, TXT) etc that you must add to the DNS server associated with your domain provider. */ + public var domainNameRecords: [DomainNameRecord] + /** The optional catch all inbox that will receive emails sent to the domain that cannot be matched. */ + public var catchAllInboxId: UUID? + public var createdAt: Date + public var updatedAt: Date + /** Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails. */ + public var domainType: DomainType + + public init(_id: UUID, userId: UUID, domain: String, verificationToken: String, dkimTokens: [String], isVerified: Bool, domainNameRecords: [DomainNameRecord], catchAllInboxId: UUID? = nil, createdAt: Date, updatedAt: Date, domainType: DomainType) { + self._id = _id + self.userId = userId + self.domain = domain + self.verificationToken = verificationToken + self.dkimTokens = dkimTokens + self.isVerified = isVerified + self.domainNameRecords = domainNameRecords + self.catchAllInboxId = catchAllInboxId + self.createdAt = createdAt + self.updatedAt = updatedAt + self.domainType = domainType + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case domain + case verificationToken + case dkimTokens + case isVerified + case domainNameRecords + case catchAllInboxId + case createdAt + case updatedAt + case domainType + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(domain, forKey: .domain) + try container.encode(verificationToken, forKey: .verificationToken) + try container.encode(dkimTokens, forKey: .dkimTokens) + try container.encode(isVerified, forKey: .isVerified) + try container.encode(domainNameRecords, forKey: .domainNameRecords) + try container.encodeIfPresent(catchAllInboxId, forKey: .catchAllInboxId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(domainType, forKey: .domainType) + } + + + +} diff --git a/mailslurp/Models/DomainNameRecord.swift b/mailslurp/Models/DomainNameRecord.swift new file mode 100644 index 00000000..21bac844 --- /dev/null +++ b/mailslurp/Models/DomainNameRecord.swift @@ -0,0 +1,136 @@ +// +// DomainNameRecord.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** DNS Record required for verification of a domain. Record vary depending on domain type. */ +@objc public class DomainNameRecord: NSObject, Codable { + + public enum RecordType: String, Codable, CaseIterable { + case a = "A" + case ns = "NS" + case md = "MD" + case mf = "MF" + case cname = "CNAME" + case soa = "SOA" + case mb = "MB" + case mg = "MG" + case mr = "MR" + case null = "NULL" + case wks = "WKS" + case ptr = "PTR" + case hinfo = "HINFO" + case minfo = "MINFO" + case mx = "MX" + case txt = "TXT" + case rp = "RP" + case afsdb = "AFSDB" + case x25 = "X25" + case isdn = "ISDN" + case rt = "RT" + case nsap = "NSAP" + case nsapPtr = "NSAP_PTR" + case sig = "SIG" + case key = "KEY" + case px = "PX" + case gpos = "GPOS" + case aaaa = "AAAA" + case loc = "LOC" + case nxt = "NXT" + case eid = "EID" + case nimloc = "NIMLOC" + case srv = "SRV" + case atma = "ATMA" + case naptr = "NAPTR" + case kx = "KX" + case cert = "CERT" + case a6 = "A6" + case dname = "DNAME" + case sink = "SINK" + case opt = "OPT" + case apl = "APL" + case ds = "DS" + case sshfp = "SSHFP" + case ipseckey = "IPSECKEY" + case rrsig = "RRSIG" + case nsec = "NSEC" + case dnskey = "DNSKEY" + case dhcid = "DHCID" + case nsec3 = "NSEC3" + case nsec3param = "NSEC3PARAM" + case tlsa = "TLSA" + case smimea = "SMIMEA" + case hip = "HIP" + case ninfo = "NINFO" + case rkey = "RKEY" + case talink = "TALINK" + case cds = "CDS" + case cdnskey = "CDNSKEY" + case openpgpkey = "OPENPGPKEY" + case csync = "CSYNC" + case zonemd = "ZONEMD" + case svcb = "SVCB" + case https = "HTTPS" + case spf = "SPF" + case uinfo = "UINFO" + case uid = "UID" + case gid = "GID" + case unspec = "UNSPEC" + case nid = "NID" + case l32 = "L32" + case l64 = "L64" + case lp = "LP" + case eui48 = "EUI48" + case eui64 = "EUI64" + case tkey = "TKEY" + case tsig = "TSIG" + case ixfr = "IXFR" + case axfr = "AXFR" + case mailb = "MAILB" + case maila = "MAILA" + case any = "ANY" + case uri = "URI" + case caa = "CAA" + case avc = "AVC" + case doa = "DOA" + case amtrelay = "AMTRELAY" + case ta = "TA" + case dlv = "DLV" + } + /** Domain Name Server Record Types */ + public var recordType: RecordType + public var name: String + public var recordEntries: [String] + public var ttl: Int64 + + public init(recordType: RecordType, name: String, recordEntries: [String], ttl: Int64) { + self.recordType = recordType + self.name = name + self.recordEntries = recordEntries + self.ttl = ttl + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case recordType + case name + case recordEntries + case ttl + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(recordType, forKey: .recordType) + try container.encode(name, forKey: .name) + try container.encode(recordEntries, forKey: .recordEntries) + try container.encode(ttl, forKey: .ttl) + } + + + +} diff --git a/mailslurp/Models/DomainPreview.swift b/mailslurp/Models/DomainPreview.swift new file mode 100644 index 00000000..706d91ae --- /dev/null +++ b/mailslurp/Models/DomainPreview.swift @@ -0,0 +1,57 @@ +// +// DomainPreview.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Preview object for domain entity */ +@objc public class DomainPreview: NSObject, Codable { + + public enum DomainType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpDomain = "SMTP_DOMAIN" + } + public var _id: UUID + public var domain: String + public var catchAllInboxId: UUID? + public var createdAt: Date + /** Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails. */ + public var domainType: DomainType + public var isVerified: Bool + + public init(_id: UUID, domain: String, catchAllInboxId: UUID? = nil, createdAt: Date, domainType: DomainType, isVerified: Bool) { + self._id = _id + self.domain = domain + self.catchAllInboxId = catchAllInboxId + self.createdAt = createdAt + self.domainType = domainType + self.isVerified = isVerified + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case domain + case catchAllInboxId + case createdAt + case domainType + case isVerified + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(domain, forKey: .domain) + try container.encodeIfPresent(catchAllInboxId, forKey: .catchAllInboxId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(domainType, forKey: .domainType) + try container.encode(isVerified, forKey: .isVerified) + } + + + +} diff --git a/mailslurp/Models/DownloadAttachmentDto.swift b/mailslurp/Models/DownloadAttachmentDto.swift new file mode 100644 index 00000000..37eb94f2 --- /dev/null +++ b/mailslurp/Models/DownloadAttachmentDto.swift @@ -0,0 +1,43 @@ +// +// DownloadAttachmentDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Content of attachment */ +@objc public class DownloadAttachmentDto: NSObject, Codable { + + /** Base64 encoded string of attachment bytes. Decode the base64 encoded string to get the raw contents. If the file has a content type such as `text/html` you can read the contents directly by converting it to string using `utf-8` encoding. */ + public var base64FileContents: String + /** Content type of attachment. Examples are `image/png`, `application/msword`, `text/csv` etc. */ + public var contentType: String + /** Size in bytes of attachment content */ + public var sizeBytes: Int64 + + public init(base64FileContents: String, contentType: String, sizeBytes: Int64) { + self.base64FileContents = base64FileContents + self.contentType = contentType + self.sizeBytes = sizeBytes + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case base64FileContents + case contentType + case sizeBytes + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(base64FileContents, forKey: .base64FileContents) + try container.encode(contentType, forKey: .contentType) + try container.encode(sizeBytes, forKey: .sizeBytes) + } + + + +} diff --git a/mailslurp/Models/Email.swift b/mailslurp/Models/Email.swift new file mode 100644 index 00000000..d2bef917 --- /dev/null +++ b/mailslurp/Models/Email.swift @@ -0,0 +1,159 @@ +// +// Email.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email entity (also known as EmailDto). When an SMTP email message is received by MailSlurp it is parsed. The body and attachments are written to disk and the fields such as to, from, subject etc are stored in a database. The `body` contains the email content. If you want the original SMTP message see the `getRawEmail` endpoints. The attachments can be fetched using the AttachmentController */ +@objc public class Email: NSObject, Codable { + + /** ID of the email entity */ + public var _id: UUID + /** ID of user that email belongs to */ + public var userId: UUID + /** ID of the inbox that received the email */ + public var inboxId: UUID + /** ID of the domain that received the email */ + public var domainId: UUID? + /** List of `To` recipient email addresses that the email was addressed to. See recipients object for names. */ + public var to: [String] + /** Who the email was sent from. An email address - see fromName for the sender name. */ + public var from: String? + public var sender: Sender? + public var recipients: EmailRecipients? + /** The `replyTo` field on the received email message */ + public var replyTo: String? + /** List of `CC` recipients email addresses that the email was addressed to. See recipients object for names. */ + public var cc: [String]? + /** List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names. */ + public var bcc: [String]? + /** Collection of SMTP headers attached to email */ + public var headers: [String: String]? + /** List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension. */ + public var attachments: [String]? + /** The subject line of the email message as specified by SMTP subject header */ + public var subject: String? + /** The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests. */ + public var body: String? + /** An excerpt of the body of the email message for quick preview . */ + public var bodyExcerpt: String? + /** A hash signature of the email message using MD5. Useful for comparing emails without fetching full body. */ + public var bodyMD5Hash: String? + /** Is the email body content type HTML? */ + public var isHTML: Bool? + public var isHTMLNum: NSNumber? { + get { + return isHTML as NSNumber? + } + } + /** Detected character set of the email body such as UTF-8 */ + public var charset: String? + public var analysis: EmailAnalysis? + /** When was the email received by MailSlurp */ + public var createdAt: Date + /** When was the email last updated */ + public var updatedAt: Date + /** Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks. */ + public var read: Bool + /** Can the email be accessed by organization team members */ + public var teamAccess: Bool + public var html: Bool? + public var htmlNum: NSNumber? { + get { + return html as NSNumber? + } + } + + public init(_id: UUID, userId: UUID, inboxId: UUID, domainId: UUID? = nil, to: [String], from: String? = nil, sender: Sender? = nil, recipients: EmailRecipients? = nil, replyTo: String? = nil, cc: [String]? = nil, bcc: [String]? = nil, headers: [String: String]? = nil, attachments: [String]? = nil, subject: String? = nil, body: String? = nil, bodyExcerpt: String? = nil, bodyMD5Hash: String? = nil, isHTML: Bool? = nil, charset: String? = nil, analysis: EmailAnalysis? = nil, createdAt: Date, updatedAt: Date, read: Bool, teamAccess: Bool, html: Bool? = nil) { + self._id = _id + self.userId = userId + self.inboxId = inboxId + self.domainId = domainId + self.to = to + self.from = from + self.sender = sender + self.recipients = recipients + self.replyTo = replyTo + self.cc = cc + self.bcc = bcc + self.headers = headers + self.attachments = attachments + self.subject = subject + self.body = body + self.bodyExcerpt = bodyExcerpt + self.bodyMD5Hash = bodyMD5Hash + self.isHTML = isHTML + self.charset = charset + self.analysis = analysis + self.createdAt = createdAt + self.updatedAt = updatedAt + self.read = read + self.teamAccess = teamAccess + self.html = html + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case inboxId + case domainId + case to + case from + case sender + case recipients + case replyTo + case cc + case bcc + case headers + case attachments + case subject + case body + case bodyExcerpt + case bodyMD5Hash + case isHTML + case charset + case analysis + case createdAt + case updatedAt + case read + case teamAccess + case html + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(inboxId, forKey: .inboxId) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encode(to, forKey: .to) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(sender, forKey: .sender) + try container.encodeIfPresent(recipients, forKey: .recipients) + try container.encodeIfPresent(replyTo, forKey: .replyTo) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(headers, forKey: .headers) + try container.encodeIfPresent(attachments, forKey: .attachments) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(body, forKey: .body) + try container.encodeIfPresent(bodyExcerpt, forKey: .bodyExcerpt) + try container.encodeIfPresent(bodyMD5Hash, forKey: .bodyMD5Hash) + try container.encodeIfPresent(isHTML, forKey: .isHTML) + try container.encodeIfPresent(charset, forKey: .charset) + try container.encodeIfPresent(analysis, forKey: .analysis) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(read, forKey: .read) + try container.encode(teamAccess, forKey: .teamAccess) + try container.encodeIfPresent(html, forKey: .html) + } + + + +} diff --git a/mailslurp/Models/EmailAnalysis.swift b/mailslurp/Models/EmailAnalysis.swift new file mode 100644 index 00000000..b6bde48c --- /dev/null +++ b/mailslurp/Models/EmailAnalysis.swift @@ -0,0 +1,53 @@ +// +// EmailAnalysis.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Analysis result for email. Each verdict property is a string PASS|FAIL|GRAY or dynamic error message */ +@objc public class EmailAnalysis: NSObject, Codable { + + /** Verdict of spam ranking analysis */ + public var spamVerdict: String? + /** Verdict of virus scan analysis */ + public var virusVerdict: String? + /** Verdict of Send Policy Framework record spoofing analysis */ + public var spfVerdict: String? + /** Verdict of DomainKeys Identified Mail analysis */ + public var dkimVerdict: String? + /** Verdict of Domain-based Message Authentication Reporting and Conformance analysis */ + public var dmarcVerdict: String? + + public init(spamVerdict: String? = nil, virusVerdict: String? = nil, spfVerdict: String? = nil, dkimVerdict: String? = nil, dmarcVerdict: String? = nil) { + self.spamVerdict = spamVerdict + self.virusVerdict = virusVerdict + self.spfVerdict = spfVerdict + self.dkimVerdict = dkimVerdict + self.dmarcVerdict = dmarcVerdict + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case spamVerdict + case virusVerdict + case spfVerdict + case dkimVerdict + case dmarcVerdict + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(spamVerdict, forKey: .spamVerdict) + try container.encodeIfPresent(virusVerdict, forKey: .virusVerdict) + try container.encodeIfPresent(spfVerdict, forKey: .spfVerdict) + try container.encodeIfPresent(dkimVerdict, forKey: .dkimVerdict) + try container.encodeIfPresent(dmarcVerdict, forKey: .dmarcVerdict) + } + + + +} diff --git a/mailslurp/Models/EmailContentMatchResult.swift b/mailslurp/Models/EmailContentMatchResult.swift new file mode 100644 index 00000000..459c87bf --- /dev/null +++ b/mailslurp/Models/EmailContentMatchResult.swift @@ -0,0 +1,36 @@ +// +// EmailContentMatchResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Matches for the given pattern */ +@objc public class EmailContentMatchResult: NSObject, Codable { + + public var pattern: String + public var matches: [String] + + public init(pattern: String, matches: [String]) { + self.pattern = pattern + self.matches = matches + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case pattern + case matches + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(pattern, forKey: .pattern) + try container.encode(matches, forKey: .matches) + } + + + +} diff --git a/mailslurp/Models/EmailHtmlDto.swift b/mailslurp/Models/EmailHtmlDto.swift new file mode 100644 index 00000000..45c6b455 --- /dev/null +++ b/mailslurp/Models/EmailHtmlDto.swift @@ -0,0 +1,35 @@ +// +// EmailHtmlDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class EmailHtmlDto: NSObject, Codable { + + public var subject: String? + public var body: String? + + public init(subject: String? = nil, body: String? = nil) { + self.subject = subject + self.body = body + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case subject + case body + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(body, forKey: .body) + } + + + +} diff --git a/mailslurp/Models/EmailLinksResult.swift b/mailslurp/Models/EmailLinksResult.swift new file mode 100644 index 00000000..407d5a27 --- /dev/null +++ b/mailslurp/Models/EmailLinksResult.swift @@ -0,0 +1,36 @@ +// +// EmailLinksResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Links found in HTML */ +@objc public class EmailLinksResult: NSObject, Codable { + + public var links: [String] + public var body: String + + public init(links: [String], body: String) { + self.links = links + self.body = body + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case links + case body + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(links, forKey: .links) + try container.encode(body, forKey: .body) + } + + + +} diff --git a/mailslurp/Models/EmailPreview.swift b/mailslurp/Models/EmailPreview.swift new file mode 100644 index 00000000..b744d2c6 --- /dev/null +++ b/mailslurp/Models/EmailPreview.swift @@ -0,0 +1,78 @@ +// +// EmailPreview.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Preview of an email message. For full message (including body and attachments) call the `getEmail` or other email endpoints with the provided email ID. */ +@objc public class EmailPreview: NSObject, Codable { + + /** ID of the email entity */ + public var _id: UUID + /** ID of the domain that received the email */ + public var domainId: UUID? + /** The subject line of the email message as specified by SMTP subject header */ + public var subject: String? + /** List of `To` recipient email addresses that the email was addressed to. See recipients object for names. */ + public var to: [String]? + /** Who the email was sent from. An email address - see fromName for the sender name. */ + public var from: String? + /** List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names. */ + public var bcc: [String]? + /** List of `CC` recipients email addresses that the email was addressed to. See recipients object for names. */ + public var cc: [String]? + /** When was the email received by MailSlurp */ + public var createdAt: Date + /** Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks. */ + public var read: Bool + /** List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension. */ + public var attachments: [String]? + + public init(_id: UUID, domainId: UUID? = nil, subject: String? = nil, to: [String]?, from: String? = nil, bcc: [String]? = nil, cc: [String]? = nil, createdAt: Date, read: Bool, attachments: [String]? = nil) { + self._id = _id + self.domainId = domainId + self.subject = subject + self.to = to + self.from = from + self.bcc = bcc + self.cc = cc + self.createdAt = createdAt + self.read = read + self.attachments = attachments + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case domainId + case subject + case to + case from + case bcc + case cc + case createdAt + case read + case attachments + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(to, forKey: .to) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(read, forKey: .read) + try container.encodeIfPresent(attachments, forKey: .attachments) + } + + + +} diff --git a/mailslurp/Models/EmailPreviewUrls.swift b/mailslurp/Models/EmailPreviewUrls.swift new file mode 100644 index 00000000..0100c179 --- /dev/null +++ b/mailslurp/Models/EmailPreviewUrls.swift @@ -0,0 +1,36 @@ +// +// EmailPreviewUrls.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** URLs for email body */ +@objc public class EmailPreviewUrls: NSObject, Codable { + + public var rawSmtpMessageUrl: String + public var plainHtmlBodyUrl: String + + public init(rawSmtpMessageUrl: String, plainHtmlBodyUrl: String) { + self.rawSmtpMessageUrl = rawSmtpMessageUrl + self.plainHtmlBodyUrl = plainHtmlBodyUrl + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case rawSmtpMessageUrl + case plainHtmlBodyUrl + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(rawSmtpMessageUrl, forKey: .rawSmtpMessageUrl) + try container.encode(plainHtmlBodyUrl, forKey: .plainHtmlBodyUrl) + } + + + +} diff --git a/mailslurp/Models/EmailProjection.swift b/mailslurp/Models/EmailProjection.swift new file mode 100644 index 00000000..414ff890 --- /dev/null +++ b/mailslurp/Models/EmailProjection.swift @@ -0,0 +1,84 @@ +// +// EmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** A compact representation of a full email. Used in list endpoints to keep response sizes low. Body and attachments are not included. To get all fields of the email use the `getEmail` method with the email projection's ID. See `EmailDto` for documentation on projection properties. */ +@objc public class EmailProjection: NSObject, Codable { + + public var _id: UUID + public var from: String? + public var subject: String? + public var attachments: [String]? + public var inboxId: UUID + public var to: [String] + public var createdAt: Date + public var bcc: [String]? + public var cc: [String]? + public var domainId: UUID? + public var bodyMD5Hash: String? + public var bodyExcerpt: String? + public var read: Bool + public var teamAccess: Bool + + public init(_id: UUID, from: String? = nil, subject: String? = nil, attachments: [String]? = nil, inboxId: UUID, to: [String], createdAt: Date, bcc: [String]? = nil, cc: [String]? = nil, domainId: UUID? = nil, bodyMD5Hash: String? = nil, bodyExcerpt: String? = nil, read: Bool, teamAccess: Bool) { + self._id = _id + self.from = from + self.subject = subject + self.attachments = attachments + self.inboxId = inboxId + self.to = to + self.createdAt = createdAt + self.bcc = bcc + self.cc = cc + self.domainId = domainId + self.bodyMD5Hash = bodyMD5Hash + self.bodyExcerpt = bodyExcerpt + self.read = read + self.teamAccess = teamAccess + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case from + case subject + case attachments + case inboxId + case to + case createdAt + case bcc + case cc + case domainId + case bodyMD5Hash + case bodyExcerpt + case read + case teamAccess + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(attachments, forKey: .attachments) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(to, forKey: .to) + try container.encode(createdAt, forKey: .createdAt) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encodeIfPresent(bodyMD5Hash, forKey: .bodyMD5Hash) + try container.encodeIfPresent(bodyExcerpt, forKey: .bodyExcerpt) + try container.encode(read, forKey: .read) + try container.encode(teamAccess, forKey: .teamAccess) + } + + + +} diff --git a/mailslurp/Models/EmailRecipients.swift b/mailslurp/Models/EmailRecipients.swift new file mode 100644 index 00000000..74be2f66 --- /dev/null +++ b/mailslurp/Models/EmailRecipients.swift @@ -0,0 +1,40 @@ +// +// EmailRecipients.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** The `To`,`CC`,`BCC` recipients stored in object form with email address and name accessible. */ +@objc public class EmailRecipients: NSObject, Codable { + + public var to: [Recipient]? + public var cc: [Recipient]? + public var bcc: [Recipient]? + + public init(to: [Recipient]? = nil, cc: [Recipient]? = nil, bcc: [Recipient]? = nil) { + self.to = to + self.cc = cc + self.bcc = bcc + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case to + case cc + case bcc + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(to, forKey: .to) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encodeIfPresent(bcc, forKey: .bcc) + } + + + +} diff --git a/mailslurp/Models/EmailTextLinesResult.swift b/mailslurp/Models/EmailTextLinesResult.swift new file mode 100644 index 00000000..b5283aed --- /dev/null +++ b/mailslurp/Models/EmailTextLinesResult.swift @@ -0,0 +1,36 @@ +// +// EmailTextLinesResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Parsed text of an email */ +@objc public class EmailTextLinesResult: NSObject, Codable { + + public var lines: [String] + public var body: String + + public init(lines: [String], body: String) { + self.lines = lines + self.body = body + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case lines + case body + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(lines, forKey: .lines) + try container.encode(body, forKey: .body) + } + + + +} diff --git a/mailslurp/Models/EmailValidationRequest.swift b/mailslurp/Models/EmailValidationRequest.swift new file mode 100644 index 00000000..33a68bde --- /dev/null +++ b/mailslurp/Models/EmailValidationRequest.swift @@ -0,0 +1,52 @@ +// +// EmailValidationRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email validation request */ +@objc public class EmailValidationRequest: NSObject, Codable { + + public var _id: UUID? + public var userId: UUID + public var emailAddress: String + public var isValid: Bool + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID? = nil, userId: UUID, emailAddress: String, isValid: Bool, createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.emailAddress = emailAddress + self.isValid = isValid + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case emailAddress + case isValid + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encode(isValid, forKey: .isValid) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/EmailVerificationResult.swift b/mailslurp/Models/EmailVerificationResult.swift new file mode 100644 index 00000000..47ed72cc --- /dev/null +++ b/mailslurp/Models/EmailVerificationResult.swift @@ -0,0 +1,48 @@ +// +// EmailVerificationResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email verification result. Valid means email address exists according to response from mail server running at the domain and port given. */ +@objc public class EmailVerificationResult: NSObject, Codable { + + public var domainName: String + public var port: Int + public var emailAddress: String + public var isValid: Bool + public var error: String? + + public init(domainName: String, port: Int, emailAddress: String, isValid: Bool, error: String? = nil) { + self.domainName = domainName + self.port = port + self.emailAddress = emailAddress + self.isValid = isValid + self.error = error + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case domainName + case port + case emailAddress + case isValid + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(domainName, forKey: .domainName) + try container.encode(port, forKey: .port) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encode(isValid, forKey: .isValid) + try container.encodeIfPresent(error, forKey: .error) + } + + + +} diff --git a/mailslurp/Models/EmergencyAddress.swift b/mailslurp/Models/EmergencyAddress.swift new file mode 100644 index 00000000..1d936435 --- /dev/null +++ b/mailslurp/Models/EmergencyAddress.swift @@ -0,0 +1,83 @@ +// +// EmergencyAddress.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class EmergencyAddress: NSObject, Codable { + + public enum PhoneCountry: String, Codable, CaseIterable { + case us = "US" + case gb = "GB" + } + public var _id: UUID? + public var sid: String + public var userId: UUID + public var displayName: String + public var customerName: String + public var address1: String + public var city: String + public var region: String + public var postalCode: String + public var phoneCountry: PhoneCountry + public var accountSid: String + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID? = nil, sid: String, userId: UUID, displayName: String, customerName: String, address1: String, city: String, region: String, postalCode: String, phoneCountry: PhoneCountry, accountSid: String, createdAt: Date, updatedAt: Date) { + self._id = _id + self.sid = sid + self.userId = userId + self.displayName = displayName + self.customerName = customerName + self.address1 = address1 + self.city = city + self.region = region + self.postalCode = postalCode + self.phoneCountry = phoneCountry + self.accountSid = accountSid + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case sid + case userId + case displayName + case customerName + case address1 + case city + case region + case postalCode + case phoneCountry + case accountSid + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encode(sid, forKey: .sid) + try container.encode(userId, forKey: .userId) + try container.encode(displayName, forKey: .displayName) + try container.encode(customerName, forKey: .customerName) + try container.encode(address1, forKey: .address1) + try container.encode(city, forKey: .city) + try container.encode(region, forKey: .region) + try container.encode(postalCode, forKey: .postalCode) + try container.encode(phoneCountry, forKey: .phoneCountry) + try container.encode(accountSid, forKey: .accountSid) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/EmergencyAddressDto.swift b/mailslurp/Models/EmergencyAddressDto.swift new file mode 100644 index 00000000..b267d8af --- /dev/null +++ b/mailslurp/Models/EmergencyAddressDto.swift @@ -0,0 +1,43 @@ +// +// EmergencyAddressDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class EmergencyAddressDto: NSObject, Codable { + + public enum PhoneCountry: String, Codable, CaseIterable { + case us = "US" + case gb = "GB" + } + public var _id: UUID + public var address1: String + public var phoneCountry: PhoneCountry + + public init(_id: UUID, address1: String, phoneCountry: PhoneCountry) { + self._id = _id + self.address1 = address1 + self.phoneCountry = phoneCountry + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case address1 + case phoneCountry + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(address1, forKey: .address1) + try container.encode(phoneCountry, forKey: .phoneCountry) + } + + + +} diff --git a/mailslurp/Models/EmptyResponseDto.swift b/mailslurp/Models/EmptyResponseDto.swift new file mode 100644 index 00000000..2056e335 --- /dev/null +++ b/mailslurp/Models/EmptyResponseDto.swift @@ -0,0 +1,31 @@ +// +// EmptyResponseDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class EmptyResponseDto: NSObject, Codable { + + public var message: String? + + public init(message: String? = nil) { + self.message = message + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(message, forKey: .message) + } + + + +} diff --git a/mailslurp/Models/ExpirationDefaults.swift b/mailslurp/Models/ExpirationDefaults.swift new file mode 100644 index 00000000..9ec675af --- /dev/null +++ b/mailslurp/Models/ExpirationDefaults.swift @@ -0,0 +1,58 @@ +// +// ExpirationDefaults.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Expiration defaults for your account */ +@objc public class ExpirationDefaults: NSObject, Codable { + + public var defaultExpirationMillis: Int64? + public var defaultExpirationMillisNum: NSNumber? { + get { + return defaultExpirationMillis as NSNumber? + } + } + public var maxExpirationMillis: Int64? + public var maxExpirationMillisNum: NSNumber? { + get { + return maxExpirationMillis as NSNumber? + } + } + public var defaultExpiresAt: Date? + public var canPermanentInbox: Bool + public var nextInboxAllowsPermanent: Bool + + public init(defaultExpirationMillis: Int64? = nil, maxExpirationMillis: Int64? = nil, defaultExpiresAt: Date? = nil, canPermanentInbox: Bool, nextInboxAllowsPermanent: Bool) { + self.defaultExpirationMillis = defaultExpirationMillis + self.maxExpirationMillis = maxExpirationMillis + self.defaultExpiresAt = defaultExpiresAt + self.canPermanentInbox = canPermanentInbox + self.nextInboxAllowsPermanent = nextInboxAllowsPermanent + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case defaultExpirationMillis + case maxExpirationMillis + case defaultExpiresAt + case canPermanentInbox + case nextInboxAllowsPermanent + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(defaultExpirationMillis, forKey: .defaultExpirationMillis) + try container.encodeIfPresent(maxExpirationMillis, forKey: .maxExpirationMillis) + try container.encodeIfPresent(defaultExpiresAt, forKey: .defaultExpiresAt) + try container.encode(canPermanentInbox, forKey: .canPermanentInbox) + try container.encode(nextInboxAllowsPermanent, forKey: .nextInboxAllowsPermanent) + } + + + +} diff --git a/mailslurp/Models/ExpiredInboxDto.swift b/mailslurp/Models/ExpiredInboxDto.swift new file mode 100644 index 00000000..d060dd54 --- /dev/null +++ b/mailslurp/Models/ExpiredInboxDto.swift @@ -0,0 +1,40 @@ +// +// ExpiredInboxDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Expired inbox */ +@objc public class ExpiredInboxDto: NSObject, Codable { + + public var _id: UUID + public var inboxId: UUID + public var emailAddress: String + + public init(_id: UUID, inboxId: UUID, emailAddress: String) { + self._id = _id + self.inboxId = inboxId + self.emailAddress = emailAddress + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case inboxId + case emailAddress + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(emailAddress, forKey: .emailAddress) + } + + + +} diff --git a/mailslurp/Models/ExpiredInboxRecordProjection.swift b/mailslurp/Models/ExpiredInboxRecordProjection.swift new file mode 100644 index 00000000..d8d47c76 --- /dev/null +++ b/mailslurp/Models/ExpiredInboxRecordProjection.swift @@ -0,0 +1,44 @@ +// +// ExpiredInboxRecordProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Record of inbox expiration */ +@objc public class ExpiredInboxRecordProjection: NSObject, Codable { + + public var _id: UUID + public var userId: UUID + public var emailAddress: String + public var createdAt: Date + + public init(_id: UUID, userId: UUID, emailAddress: String, createdAt: Date) { + self._id = _id + self.userId = userId + self.emailAddress = emailAddress + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case emailAddress + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/ExportLink.swift b/mailslurp/Models/ExportLink.swift new file mode 100644 index 00000000..070edcdd --- /dev/null +++ b/mailslurp/Models/ExportLink.swift @@ -0,0 +1,32 @@ +// +// ExportLink.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Export download link */ +@objc public class ExportLink: NSObject, Codable { + + public var downloadLink: String + + public init(downloadLink: String) { + self.downloadLink = downloadLink + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case downloadLink + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(downloadLink, forKey: .downloadLink) + } + + + +} diff --git a/mailslurp/Models/ExportOptions.swift b/mailslurp/Models/ExportOptions.swift new file mode 100644 index 00000000..d74668f9 --- /dev/null +++ b/mailslurp/Models/ExportOptions.swift @@ -0,0 +1,61 @@ +// +// ExportOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for exporting user data */ +@objc public class ExportOptions: NSObject, Codable { + + public enum OutputFormat: String, Codable, CaseIterable { + case _default = "CSV_DEFAULT" + case excel = "CSV_EXCEL" + } + public var outputFormat: OutputFormat + public var excludePreviouslyExported: Bool? + public var excludePreviouslyExportedNum: NSNumber? { + get { + return excludePreviouslyExported as NSNumber? + } + } + public var createdEarliestTime: Date? + public var createdOldestTime: Date? + public var filter: String? + public var listSeparatorToken: String? + + public init(outputFormat: OutputFormat, excludePreviouslyExported: Bool? = nil, createdEarliestTime: Date? = nil, createdOldestTime: Date? = nil, filter: String? = nil, listSeparatorToken: String? = nil) { + self.outputFormat = outputFormat + self.excludePreviouslyExported = excludePreviouslyExported + self.createdEarliestTime = createdEarliestTime + self.createdOldestTime = createdOldestTime + self.filter = filter + self.listSeparatorToken = listSeparatorToken + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case outputFormat + case excludePreviouslyExported + case createdEarliestTime + case createdOldestTime + case filter + case listSeparatorToken + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(outputFormat, forKey: .outputFormat) + try container.encodeIfPresent(excludePreviouslyExported, forKey: .excludePreviouslyExported) + try container.encodeIfPresent(createdEarliestTime, forKey: .createdEarliestTime) + try container.encodeIfPresent(createdOldestTime, forKey: .createdOldestTime) + try container.encodeIfPresent(filter, forKey: .filter) + try container.encodeIfPresent(listSeparatorToken, forKey: .listSeparatorToken) + } + + + +} diff --git a/mailslurp/Models/FilterBouncedRecipientsOptions.swift b/mailslurp/Models/FilterBouncedRecipientsOptions.swift new file mode 100644 index 00000000..bf786357 --- /dev/null +++ b/mailslurp/Models/FilterBouncedRecipientsOptions.swift @@ -0,0 +1,32 @@ +// +// FilterBouncedRecipientsOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for filtering bounced email recipients */ +@objc public class FilterBouncedRecipientsOptions: NSObject, Codable { + + public var emailRecipients: [String] + + public init(emailRecipients: [String]) { + self.emailRecipients = emailRecipients + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case emailRecipients + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(emailRecipients, forKey: .emailRecipients) + } + + + +} diff --git a/mailslurp/Models/FilterBouncedRecipientsResult.swift b/mailslurp/Models/FilterBouncedRecipientsResult.swift new file mode 100644 index 00000000..53e5dee9 --- /dev/null +++ b/mailslurp/Models/FilterBouncedRecipientsResult.swift @@ -0,0 +1,32 @@ +// +// FilterBouncedRecipientsResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Remaining recipients that were filtered to remove bounced recipients */ +@objc public class FilterBouncedRecipientsResult: NSObject, Codable { + + public var filteredRecipients: [String] + + public init(filteredRecipients: [String]) { + self.filteredRecipients = filteredRecipients + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case filteredRecipients + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(filteredRecipients, forKey: .filteredRecipients) + } + + + +} diff --git a/mailslurp/Models/FlushExpiredInboxesResult.swift b/mailslurp/Models/FlushExpiredInboxesResult.swift new file mode 100644 index 00000000..3aee0f9f --- /dev/null +++ b/mailslurp/Models/FlushExpiredInboxesResult.swift @@ -0,0 +1,38 @@ +// +// FlushExpiredInboxesResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result from calling expire on any inboxes that have applicable expiration dates given current time. */ +@objc public class FlushExpiredInboxesResult: NSObject, Codable { + + /** Inbox IDs affected by expiration */ + public var inboxIds: [UUID] + /** DateTime to filter inboxes so that those expiring before this time are expired */ + public var expireBefore: Date + + public init(inboxIds: [UUID], expireBefore: Date) { + self.inboxIds = inboxIds + self.expireBefore = expireBefore + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxIds + case expireBefore + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(inboxIds, forKey: .inboxIds) + try container.encode(expireBefore, forKey: .expireBefore) + } + + + +} diff --git a/mailslurp/Models/ForwardEmailOptions.swift b/mailslurp/Models/ForwardEmailOptions.swift new file mode 100644 index 00000000..e2934294 --- /dev/null +++ b/mailslurp/Models/ForwardEmailOptions.swift @@ -0,0 +1,63 @@ +// +// ForwardEmailOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for forwarding an email */ +@objc public class ForwardEmailOptions: NSObject, Codable { + + /** To recipients for forwarded email */ + public var to: [String] + /** Subject for forwarded email */ + public var subject: String? + /** Optional cc recipients */ + public var cc: [String]? + /** Optional bcc recipients */ + public var bcc: [String]? + /** Optional from override */ + public var from: String? + /** Optionally use inbox name as display name for sender email address */ + public var useInboxName: Bool? + public var useInboxNameNum: NSNumber? { + get { + return useInboxName as NSNumber? + } + } + + public init(to: [String], subject: String? = nil, cc: [String]? = nil, bcc: [String]? = nil, from: String? = nil, useInboxName: Bool? = nil) { + self.to = to + self.subject = subject + self.cc = cc + self.bcc = bcc + self.from = from + self.useInboxName = useInboxName + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case to + case subject + case cc + case bcc + case from + case useInboxName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(to, forKey: .to) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(useInboxName, forKey: .useInboxName) + } + + + +} diff --git a/mailslurp/Models/GravatarUrl.swift b/mailslurp/Models/GravatarUrl.swift new file mode 100644 index 00000000..f5b41b8f --- /dev/null +++ b/mailslurp/Models/GravatarUrl.swift @@ -0,0 +1,36 @@ +// +// GravatarUrl.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** User image */ +@objc public class GravatarUrl: NSObject, Codable { + + public var url: String + public var _hash: String + + public init(url: String, _hash: String) { + self.url = url + self._hash = _hash + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case url + case _hash = "hash" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(url, forKey: .url) + try container.encode(_hash, forKey: ._hash) + } + + + +} diff --git a/mailslurp/Models/GroupContactsDto.swift b/mailslurp/Models/GroupContactsDto.swift new file mode 100644 index 00000000..be351628 --- /dev/null +++ b/mailslurp/Models/GroupContactsDto.swift @@ -0,0 +1,36 @@ +// +// GroupContactsDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Describes contacts attached to a contact group */ +@objc public class GroupContactsDto: NSObject, Codable { + + public var group: GroupDto + public var contacts: [ContactDto] + + public init(group: GroupDto, contacts: [ContactDto]) { + self.group = group + self.contacts = contacts + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case group + case contacts + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(group, forKey: .group) + try container.encode(contacts, forKey: .contacts) + } + + + +} diff --git a/mailslurp/Models/GroupDto.swift b/mailslurp/Models/GroupDto.swift new file mode 100644 index 00000000..4fe0ef9d --- /dev/null +++ b/mailslurp/Models/GroupDto.swift @@ -0,0 +1,44 @@ +// +// GroupDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Contact group data */ +@objc public class GroupDto: NSObject, Codable { + + public var _id: UUID + public var name: String + public var _description: String? + public var createdAt: Date + + public init(_id: UUID, name: String, _description: String? = nil, createdAt: Date) { + self._id = _id + self.name = name + self._description = _description + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case name + case _description = "description" + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(name, forKey: .name) + try container.encodeIfPresent(_description, forKey: ._description) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/GroupProjection.swift b/mailslurp/Models/GroupProjection.swift new file mode 100644 index 00000000..0fdf5787 --- /dev/null +++ b/mailslurp/Models/GroupProjection.swift @@ -0,0 +1,44 @@ +// +// GroupProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Data for contact group */ +@objc public class GroupProjection: NSObject, Codable { + + public var name: String + public var _id: UUID + public var _description: String? + public var createdAt: Date + + public init(name: String, _id: UUID, _description: String? = nil, createdAt: Date) { + self.name = name + self._id = _id + self._description = _description + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _id = "id" + case _description = "description" + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(_description, forKey: ._description) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/HTMLValidationResult.swift b/mailslurp/Models/HTMLValidationResult.swift new file mode 100644 index 00000000..303ba5e8 --- /dev/null +++ b/mailslurp/Models/HTMLValidationResult.swift @@ -0,0 +1,43 @@ +// +// HTMLValidationResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** HTML Validation Results */ +@objc public class HTMLValidationResult: NSObject, Codable { + + /** Is HTML validation result valid */ + public var isValid: Bool + /** Optional errors resulting from HTML validation */ + public var errors: [ValidationMessage] + /** Optional warnings resulting from HTML validation */ + public var warnings: [ValidationMessage] + + public init(isValid: Bool, errors: [ValidationMessage], warnings: [ValidationMessage]) { + self.isValid = isValid + self.errors = errors + self.warnings = warnings + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case isValid + case errors + case warnings + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(isValid, forKey: .isValid) + try container.encode(errors, forKey: .errors) + try container.encode(warnings, forKey: .warnings) + } + + + +} diff --git a/mailslurp/Models/IPAddressResult.swift b/mailslurp/Models/IPAddressResult.swift new file mode 100644 index 00000000..524db6a9 --- /dev/null +++ b/mailslurp/Models/IPAddressResult.swift @@ -0,0 +1,36 @@ +// +// IPAddressResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** IP Address look up result for a given domain / hostname */ +@objc public class IPAddressResult: NSObject, Codable { + + public var address: String + public var hostname: String + + public init(address: String, hostname: String) { + self.address = address + self.hostname = hostname + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case address + case hostname + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(address, forKey: .address) + try container.encode(hostname, forKey: .hostname) + } + + + +} diff --git a/mailslurp/Models/ImapFlagOperationOptions.swift b/mailslurp/Models/ImapFlagOperationOptions.swift new file mode 100644 index 00000000..a558eabc --- /dev/null +++ b/mailslurp/Models/ImapFlagOperationOptions.swift @@ -0,0 +1,41 @@ +// +// ImapFlagOperationOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** IMAP operation flags */ +@objc public class ImapFlagOperationOptions: NSObject, Codable { + + public enum FlagOperation: String, Codable, CaseIterable { + case setFlags = "SET_FLAGS" + case addFlags = "ADD_FLAGS" + case removeFlags = "REMOVE_FLAGS" + } + public var flagOperation: FlagOperation + public var flags: [String] + + public init(flagOperation: FlagOperation, flags: [String]) { + self.flagOperation = flagOperation + self.flags = flags + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case flagOperation + case flags + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(flagOperation, forKey: .flagOperation) + try container.encode(flags, forKey: .flags) + } + + + +} diff --git a/mailslurp/Models/ImapSmtpAccessDetails.swift b/mailslurp/Models/ImapSmtpAccessDetails.swift new file mode 100644 index 00000000..37d866b8 --- /dev/null +++ b/mailslurp/Models/ImapSmtpAccessDetails.swift @@ -0,0 +1,68 @@ +// +// ImapSmtpAccessDetails.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Access details for inbox using SMTP or IMAP */ +@objc public class ImapSmtpAccessDetails: NSObject, Codable { + + /** SMTP server host domain */ + public var smtpServerHost: String + /** SMTP server host port */ + public var smtpServerPort: Int + /** SMTP username for login */ + public var smtpUsername: String + /** SMTP for login */ + public var smtpPassword: String + /** IMAP server host domain */ + public var imapServerHost: String + /** IMAP server host port */ + public var imapServerPort: Int + /** IMAP username for login */ + public var imapUsername: String + /** IMAP password for login */ + public var imapPassword: String + + public init(smtpServerHost: String, smtpServerPort: Int, smtpUsername: String, smtpPassword: String, imapServerHost: String, imapServerPort: Int, imapUsername: String, imapPassword: String) { + self.smtpServerHost = smtpServerHost + self.smtpServerPort = smtpServerPort + self.smtpUsername = smtpUsername + self.smtpPassword = smtpPassword + self.imapServerHost = imapServerHost + self.imapServerPort = imapServerPort + self.imapUsername = imapUsername + self.imapPassword = imapPassword + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case smtpServerHost + case smtpServerPort + case smtpUsername + case smtpPassword + case imapServerHost + case imapServerPort + case imapUsername + case imapPassword + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(smtpServerHost, forKey: .smtpServerHost) + try container.encode(smtpServerPort, forKey: .smtpServerPort) + try container.encode(smtpUsername, forKey: .smtpUsername) + try container.encode(smtpPassword, forKey: .smtpPassword) + try container.encode(imapServerHost, forKey: .imapServerHost) + try container.encode(imapServerPort, forKey: .imapServerPort) + try container.encode(imapUsername, forKey: .imapUsername) + try container.encode(imapPassword, forKey: .imapPassword) + } + + + +} diff --git a/mailslurp/Models/InboxByEmailAddressResult.swift b/mailslurp/Models/InboxByEmailAddressResult.swift new file mode 100644 index 00000000..8c26dc57 --- /dev/null +++ b/mailslurp/Models/InboxByEmailAddressResult.swift @@ -0,0 +1,36 @@ +// +// InboxByEmailAddressResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of search for inbox by email address */ +@objc public class InboxByEmailAddressResult: NSObject, Codable { + + public var inboxId: UUID? + public var exists: Bool + + public init(inboxId: UUID? = nil, exists: Bool) { + self.inboxId = inboxId + self.exists = exists + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxId + case exists + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encode(exists, forKey: .exists) + } + + + +} diff --git a/mailslurp/Models/InboxByNameResult.swift b/mailslurp/Models/InboxByNameResult.swift new file mode 100644 index 00000000..c6fd8967 --- /dev/null +++ b/mailslurp/Models/InboxByNameResult.swift @@ -0,0 +1,36 @@ +// +// InboxByNameResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of search for inbox by name */ +@objc public class InboxByNameResult: NSObject, Codable { + + public var inboxId: UUID? + public var exists: Bool + + public init(inboxId: UUID? = nil, exists: Bool) { + self.inboxId = inboxId + self.exists = exists + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxId + case exists + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encode(exists, forKey: .exists) + } + + + +} diff --git a/mailslurp/Models/InboxDto.swift b/mailslurp/Models/InboxDto.swift new file mode 100644 index 00000000..f913aa06 --- /dev/null +++ b/mailslurp/Models/InboxDto.swift @@ -0,0 +1,97 @@ +// +// InboxDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Representation of a MailSlurp inbox. An inbox has an ID and a real email address. Emails can be sent to or from this email address. Inboxes are either `SMTP` or `HTTP` mailboxes. The default, `HTTP` inboxes, use AWS SES to process emails and are best suited as test email accounts and do not support IMAP or POP3. `SMTP` inboxes use a custom mail server at `mx.mailslurp.com` and support SMTP login, IMAP and POP3. Use the `EmailController` or the `InboxController` methods to send and receive emails and attachments. Inboxes may have a description, name, and tags for display purposes. You can also favourite an inbox for easier searching. */ +@objc public class InboxDto: NSObject, Codable { + + public enum InboxType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + /** ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically. */ + public var _id: UUID + /** ID of user that inbox belongs to */ + public var userId: UUID? + /** When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`. */ + public var createdAt: Date + /** Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search */ + public var name: String? + /** ID of custom domain used by the inbox if any */ + public var domainId: UUID? + /** Description of an inbox for labelling and searching purposes */ + public var _description: String? + /** The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. */ + public var emailAddress: String + /** Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email. */ + public var expiresAt: String? + /** Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering */ + public var favourite: Bool + /** Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. */ + public var tags: [String]? + /** Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). */ + public var inboxType: InboxType? + /** Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes. */ + public var readOnly: Bool + /** Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions. */ + public var virtualInbox: Bool + + public init(_id: UUID, userId: UUID? = nil, createdAt: Date, name: String? = nil, domainId: UUID? = nil, _description: String? = nil, emailAddress: String, expiresAt: String? = nil, favourite: Bool, tags: [String]? = nil, inboxType: InboxType? = nil, readOnly: Bool, virtualInbox: Bool) { + self._id = _id + self.userId = userId + self.createdAt = createdAt + self.name = name + self.domainId = domainId + self._description = _description + self.emailAddress = emailAddress + self.expiresAt = expiresAt + self.favourite = favourite + self.tags = tags + self.inboxType = inboxType + self.readOnly = readOnly + self.virtualInbox = virtualInbox + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case createdAt + case name + case domainId + case _description = "description" + case emailAddress + case expiresAt + case favourite + case tags + case inboxType + case readOnly + case virtualInbox + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(userId, forKey: .userId) + try container.encode(createdAt, forKey: .createdAt) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encodeIfPresent(_description, forKey: ._description) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(expiresAt, forKey: .expiresAt) + try container.encode(favourite, forKey: .favourite) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encodeIfPresent(inboxType, forKey: .inboxType) + try container.encode(readOnly, forKey: .readOnly) + try container.encode(virtualInbox, forKey: .virtualInbox) + } + + + +} diff --git a/mailslurp/Models/InboxExistsDto.swift b/mailslurp/Models/InboxExistsDto.swift new file mode 100644 index 00000000..ad1d1618 --- /dev/null +++ b/mailslurp/Models/InboxExistsDto.swift @@ -0,0 +1,32 @@ +// +// InboxExistsDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of email exists query */ +@objc public class InboxExistsDto: NSObject, Codable { + + public var exists: Bool + + public init(exists: Bool) { + self.exists = exists + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case exists + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(exists, forKey: .exists) + } + + + +} diff --git a/mailslurp/Models/InboxForwarderDto.swift b/mailslurp/Models/InboxForwarderDto.swift new file mode 100644 index 00000000..763bcf48 --- /dev/null +++ b/mailslurp/Models/InboxForwarderDto.swift @@ -0,0 +1,58 @@ +// +// InboxForwarderDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Inbox forwarder */ +@objc public class InboxForwarderDto: NSObject, Codable { + + public enum Field: String, Codable, CaseIterable { + case recipients = "RECIPIENTS" + case sender = "SENDER" + case subject = "SUBJECT" + case attachments = "ATTACHMENTS" + } + public var _id: UUID + public var inboxId: UUID + public var field: Field + public var match: String + public var forwardToRecipients: [String] + public var createdAt: Date + + public init(_id: UUID, inboxId: UUID, field: Field, match: String, forwardToRecipients: [String], createdAt: Date) { + self._id = _id + self.inboxId = inboxId + self.field = field + self.match = match + self.forwardToRecipients = forwardToRecipients + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case inboxId + case field + case match + case forwardToRecipients + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(field, forKey: .field) + try container.encode(match, forKey: .match) + try container.encode(forwardToRecipients, forKey: .forwardToRecipients) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/InboxForwarderTestOptions.swift b/mailslurp/Models/InboxForwarderTestOptions.swift new file mode 100644 index 00000000..a1cda6e8 --- /dev/null +++ b/mailslurp/Models/InboxForwarderTestOptions.swift @@ -0,0 +1,32 @@ +// +// InboxForwarderTestOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for testing an inbox forwarder against a value */ +@objc public class InboxForwarderTestOptions: NSObject, Codable { + + public var testValue: String + + public init(testValue: String) { + self.testValue = testValue + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case testValue + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(testValue, forKey: .testValue) + } + + + +} diff --git a/mailslurp/Models/InboxForwarderTestResult.swift b/mailslurp/Models/InboxForwarderTestResult.swift new file mode 100644 index 00000000..b80ad672 --- /dev/null +++ b/mailslurp/Models/InboxForwarderTestResult.swift @@ -0,0 +1,36 @@ +// +// InboxForwarderTestResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Results of inbox forwarder test */ +@objc public class InboxForwarderTestResult: NSObject, Codable { + + public var matches: [String: Bool] + public var doesMatch: Bool + + public init(matches: [String: Bool], doesMatch: Bool) { + self.matches = matches + self.doesMatch = doesMatch + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case matches + case doesMatch + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(matches, forKey: .matches) + try container.encode(doesMatch, forKey: .doesMatch) + } + + + +} diff --git a/mailslurp/Models/InboxIdItem.swift b/mailslurp/Models/InboxIdItem.swift new file mode 100644 index 00000000..7138f4bb --- /dev/null +++ b/mailslurp/Models/InboxIdItem.swift @@ -0,0 +1,36 @@ +// +// InboxIdItem.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Inbox ID and email address pair */ +@objc public class InboxIdItem: NSObject, Codable { + + public var _id: UUID + public var emailAddress: String + + public init(_id: UUID, emailAddress: String) { + self._id = _id + self.emailAddress = emailAddress + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case emailAddress + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(emailAddress, forKey: .emailAddress) + } + + + +} diff --git a/mailslurp/Models/InboxIdsResult.swift b/mailslurp/Models/InboxIdsResult.swift new file mode 100644 index 00000000..2c706058 --- /dev/null +++ b/mailslurp/Models/InboxIdsResult.swift @@ -0,0 +1,32 @@ +// +// InboxIdsResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** List of inbox IDs and email addresses */ +@objc public class InboxIdsResult: NSObject, Codable { + + public var inboxIds: [InboxIdItem] + + public init(inboxIds: [InboxIdItem]) { + self.inboxIds = inboxIds + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxIds + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(inboxIds, forKey: .inboxIds) + } + + + +} diff --git a/mailslurp/Models/InboxPreview.swift b/mailslurp/Models/InboxPreview.swift new file mode 100644 index 00000000..7f9d22fd --- /dev/null +++ b/mailslurp/Models/InboxPreview.swift @@ -0,0 +1,87 @@ +// +// InboxPreview.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Inbox data */ +@objc public class InboxPreview: NSObject, Codable { + + public enum InboxType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + /** ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically. */ + public var _id: UUID + /** ID of custom domain used by the inbox if any */ + public var domainId: UUID? + /** The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. */ + public var emailAddress: String? + /** When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`. */ + public var createdAt: Date + /** Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering */ + public var favourite: Bool + /** Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search */ + public var name: String? + /** Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. */ + public var tags: [String]? + /** Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/ */ + public var teamAccess: Bool + /** Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). */ + public var inboxType: InboxType? + /** Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions. */ + public var virtualInbox: Bool + /** Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email. */ + public var expiresAt: String? + + public init(_id: UUID, domainId: UUID? = nil, emailAddress: String? = nil, createdAt: Date, favourite: Bool, name: String? = nil, tags: [String]? = nil, teamAccess: Bool, inboxType: InboxType? = nil, virtualInbox: Bool, expiresAt: String? = nil) { + self._id = _id + self.domainId = domainId + self.emailAddress = emailAddress + self.createdAt = createdAt + self.favourite = favourite + self.name = name + self.tags = tags + self.teamAccess = teamAccess + self.inboxType = inboxType + self.virtualInbox = virtualInbox + self.expiresAt = expiresAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case domainId + case emailAddress + case createdAt + case favourite + case name + case tags + case teamAccess + case inboxType + case virtualInbox + case expiresAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encodeIfPresent(emailAddress, forKey: .emailAddress) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(favourite, forKey: .favourite) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encode(teamAccess, forKey: .teamAccess) + try container.encodeIfPresent(inboxType, forKey: .inboxType) + try container.encode(virtualInbox, forKey: .virtualInbox) + try container.encodeIfPresent(expiresAt, forKey: .expiresAt) + } + + + +} diff --git a/mailslurp/Models/InboxRulesetDto.swift b/mailslurp/Models/InboxRulesetDto.swift new file mode 100644 index 00000000..102512df --- /dev/null +++ b/mailslurp/Models/InboxRulesetDto.swift @@ -0,0 +1,68 @@ +// +// InboxRulesetDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Rules for inbox */ +@objc public class InboxRulesetDto: NSObject, Codable { + + public enum Scope: String, Codable, CaseIterable { + case receivingEmails = "RECEIVING_EMAILS" + case sendingEmails = "SENDING_EMAILS" + } + public enum Action: String, Codable, CaseIterable { + case block = "BLOCK" + case allow = "ALLOW" + case filterRemove = "FILTER_REMOVE" + } + public enum Handler: String, Codable, CaseIterable { + case exception = "EXCEPTION" + } + public var _id: UUID + public var inboxId: UUID + public var scope: Scope + public var action: Action + public var target: String + public var handler: Handler + public var createdAt: Date + + public init(_id: UUID, inboxId: UUID, scope: Scope, action: Action, target: String, handler: Handler, createdAt: Date) { + self._id = _id + self.inboxId = inboxId + self.scope = scope + self.action = action + self.target = target + self.handler = handler + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case inboxId + case scope + case action + case target + case handler + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(scope, forKey: .scope) + try container.encode(action, forKey: .action) + try container.encode(target, forKey: .target) + try container.encode(handler, forKey: .handler) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/InboxRulesetTestOptions.swift b/mailslurp/Models/InboxRulesetTestOptions.swift new file mode 100644 index 00000000..83f49443 --- /dev/null +++ b/mailslurp/Models/InboxRulesetTestOptions.swift @@ -0,0 +1,32 @@ +// +// InboxRulesetTestOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Test options for inbox ruleset */ +@objc public class InboxRulesetTestOptions: NSObject, Codable { + + public var testTarget: String + + public init(testTarget: String) { + self.testTarget = testTarget + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case testTarget + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(testTarget, forKey: .testTarget) + } + + + +} diff --git a/mailslurp/Models/InboxRulesetTestResult.swift b/mailslurp/Models/InboxRulesetTestResult.swift new file mode 100644 index 00000000..4bed6248 --- /dev/null +++ b/mailslurp/Models/InboxRulesetTestResult.swift @@ -0,0 +1,37 @@ +// +// InboxRulesetTestResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of test of inbox ruleset */ +@objc public class InboxRulesetTestResult: NSObject, Codable { + + /** Map of inbox ruleset ID to boolean of if target matches */ + public var rulesetMatches: [String: Bool] + public var matches: Bool + + public init(rulesetMatches: [String: Bool], matches: Bool) { + self.rulesetMatches = rulesetMatches + self.matches = matches + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case rulesetMatches + case matches + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(rulesetMatches, forKey: .rulesetMatches) + try container.encode(matches, forKey: .matches) + } + + + +} diff --git a/mailslurp/Models/InlineObject.swift b/mailslurp/Models/InlineObject.swift new file mode 100644 index 00000000..d8b26c8f --- /dev/null +++ b/mailslurp/Models/InlineObject.swift @@ -0,0 +1,36 @@ +// +// InlineObject.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class InlineObject: NSObject, Codable { + + /** Optional content type header of attachment */ + public var contentTypeHeader: String? + public var file: URL + + public init(contentTypeHeader: String? = nil, file: URL) { + self.contentTypeHeader = contentTypeHeader + self.file = file + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case contentTypeHeader + case file + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(contentTypeHeader, forKey: .contentTypeHeader) + try container.encode(file, forKey: .file) + } + + + +} diff --git a/mailslurp/Models/InlineObject1.swift b/mailslurp/Models/InlineObject1.swift new file mode 100644 index 00000000..18a61811 --- /dev/null +++ b/mailslurp/Models/InlineObject1.swift @@ -0,0 +1,95 @@ +// +// InlineObject1.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Byte array request body */ +@objc public class InlineObject1: NSObject, Codable { + + public var short: Int? + public var shortNum: NSNumber? { + get { + return short as NSNumber? + } + } + public var char: String? + public var int: Int? + public var intNum: NSNumber? { + get { + return int as NSNumber? + } + } + public var long: Int64? + public var longNum: NSNumber? { + get { + return long as NSNumber? + } + } + public var float: Float? + public var floatNum: NSNumber? { + get { + return float as NSNumber? + } + } + public var double: Double? + public var doubleNum: NSNumber? { + get { + return double as NSNumber? + } + } + public var direct: Bool? + public var directNum: NSNumber? { + get { + return direct as NSNumber? + } + } + public var readOnly: Bool? + public var readOnlyNum: NSNumber? { + get { + return readOnly as NSNumber? + } + } + + public init(short: Int? = nil, char: String? = nil, int: Int? = nil, long: Int64? = nil, float: Float? = nil, double: Double? = nil, direct: Bool? = nil, readOnly: Bool? = nil) { + self.short = short + self.char = char + self.int = int + self.long = long + self.float = float + self.double = double + self.direct = direct + self.readOnly = readOnly + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case short + case char + case int + case long + case float + case double + case direct + case readOnly + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(short, forKey: .short) + try container.encodeIfPresent(char, forKey: .char) + try container.encodeIfPresent(int, forKey: .int) + try container.encodeIfPresent(long, forKey: .long) + try container.encodeIfPresent(float, forKey: .float) + try container.encodeIfPresent(double, forKey: .double) + try container.encodeIfPresent(direct, forKey: .direct) + try container.encodeIfPresent(readOnly, forKey: .readOnly) + } + + + +} diff --git a/mailslurp/Models/JSONSchemaDto.swift b/mailslurp/Models/JSONSchemaDto.swift new file mode 100644 index 00000000..cfcdca96 --- /dev/null +++ b/mailslurp/Models/JSONSchemaDto.swift @@ -0,0 +1,32 @@ +// +// JSONSchemaDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** JSONSchema for payload */ +@objc public class JSONSchemaDto: NSObject, Codable { + + public var value: String + + public init(value: String) { + self.value = value + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case value + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(value, forKey: .value) + } + + + +} diff --git a/mailslurp/Models/MatchOption.swift b/mailslurp/Models/MatchOption.swift new file mode 100644 index 00000000..958e8bd3 --- /dev/null +++ b/mailslurp/Models/MatchOption.swift @@ -0,0 +1,54 @@ +// +// MatchOption.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for matching emails in an inbox. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `SUBJECT` should `CONTAIN` value. */ +@objc public class MatchOption: NSObject, Codable { + + public enum Field: String, Codable, CaseIterable { + case subject = "SUBJECT" + case to = "TO" + case bcc = "BCC" + case cc = "CC" + case from = "FROM" + } + public enum Should: String, Codable, CaseIterable { + case contain = "CONTAIN" + case equal = "EQUAL" + } + /** Fields of an email object that can be used to filter results */ + public var field: Field + /** How the value of the email field specified should be compared to the value given in the match options. */ + public var should: Should + /** The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed. */ + public var value: String + + public init(field: Field, should: Should, value: String) { + self.field = field + self.should = should + self.value = value + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case field + case should + case value + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(field, forKey: .field) + try container.encode(should, forKey: .should) + try container.encode(value, forKey: .value) + } + + + +} diff --git a/mailslurp/Models/MatchOptions.swift b/mailslurp/Models/MatchOptions.swift new file mode 100644 index 00000000..9d79ec31 --- /dev/null +++ b/mailslurp/Models/MatchOptions.swift @@ -0,0 +1,38 @@ +// +// MatchOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. You can also pass conditions such as `HAS_ATTACHMENT`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController. */ +@objc public class MatchOptions: NSObject, Codable { + + /** Zero or more match options such as `{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }`. Options are additive so if one does not match the email is excluded from results */ + public var matches: [MatchOption]? + /** Zero or more conditions such as `{ condition: 'HAS_ATTACHMENTS', value: 'TRUE' }`. Note the values are the strings `TRUE|FALSE` not booleans. */ + public var conditions: [ConditionOption]? + + public init(matches: [MatchOption]? = nil, conditions: [ConditionOption]? = nil) { + self.matches = matches + self.conditions = conditions + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case matches + case conditions + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(matches, forKey: .matches) + try container.encodeIfPresent(conditions, forKey: .conditions) + } + + + +} diff --git a/mailslurp/Models/MissedEmail.swift b/mailslurp/Models/MissedEmail.swift new file mode 100644 index 00000000..e6c44bd1 --- /dev/null +++ b/mailslurp/Models/MissedEmail.swift @@ -0,0 +1,97 @@ +// +// MissedEmail.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Missed email */ +@objc public class MissedEmail: NSObject, Codable { + + public var _id: UUID? + public var userId: UUID? + public var subject: String? + public var bodyExcerpt: String? + public var attachmentCount: Int + public var from: String? + public var rawUrl: String? + public var rawKey: String? + public var rawBucket: String? + public var canRestore: Bool? + public var canRestoreNum: NSNumber? { + get { + return canRestore as NSNumber? + } + } + public var to: [String] + public var cc: [String] + public var bcc: [String] + public var inboxIds: [UUID] + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID? = nil, userId: UUID? = nil, subject: String? = nil, bodyExcerpt: String? = nil, attachmentCount: Int, from: String? = nil, rawUrl: String? = nil, rawKey: String? = nil, rawBucket: String? = nil, canRestore: Bool? = nil, to: [String], cc: [String], bcc: [String], inboxIds: [UUID], createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.subject = subject + self.bodyExcerpt = bodyExcerpt + self.attachmentCount = attachmentCount + self.from = from + self.rawUrl = rawUrl + self.rawKey = rawKey + self.rawBucket = rawBucket + self.canRestore = canRestore + self.to = to + self.cc = cc + self.bcc = bcc + self.inboxIds = inboxIds + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case subject + case bodyExcerpt + case attachmentCount + case from + case rawUrl + case rawKey + case rawBucket + case canRestore + case to + case cc + case bcc + case inboxIds + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encodeIfPresent(userId, forKey: .userId) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(bodyExcerpt, forKey: .bodyExcerpt) + try container.encode(attachmentCount, forKey: .attachmentCount) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(rawUrl, forKey: .rawUrl) + try container.encodeIfPresent(rawKey, forKey: .rawKey) + try container.encodeIfPresent(rawBucket, forKey: .rawBucket) + try container.encodeIfPresent(canRestore, forKey: .canRestore) + try container.encode(to, forKey: .to) + try container.encode(cc, forKey: .cc) + try container.encode(bcc, forKey: .bcc) + try container.encode(inboxIds, forKey: .inboxIds) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/MissedEmailProjection.swift b/mailslurp/Models/MissedEmailProjection.swift new file mode 100644 index 00000000..dc40d487 --- /dev/null +++ b/mailslurp/Models/MissedEmailProjection.swift @@ -0,0 +1,48 @@ +// +// MissedEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Missed email data */ +@objc public class MissedEmailProjection: NSObject, Codable { + + public var _id: UUID + public var from: String? + public var subject: String? + public var userId: UUID? + public var createdAt: Date + + public init(_id: UUID, from: String? = nil, subject: String? = nil, userId: UUID? = nil, createdAt: Date) { + self._id = _id + self.from = from + self.subject = subject + self.userId = userId + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case from + case subject + case userId + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(userId, forKey: .userId) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/NameServerRecord.swift b/mailslurp/Models/NameServerRecord.swift new file mode 100644 index 00000000..9834bab4 --- /dev/null +++ b/mailslurp/Models/NameServerRecord.swift @@ -0,0 +1,44 @@ +// +// NameServerRecord.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Name Server Record */ +@objc public class NameServerRecord: NSObject, Codable { + + public var raw: String + public var recordType: String + public var priority: String + public var value: String + + public init(raw: String, recordType: String, priority: String, value: String) { + self.raw = raw + self.recordType = recordType + self.priority = priority + self.value = value + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case raw + case recordType + case priority + case value + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(raw, forKey: .raw) + try container.encode(recordType, forKey: .recordType) + try container.encode(priority, forKey: .priority) + try container.encode(value, forKey: .value) + } + + + +} diff --git a/mailslurp/Models/OrganizationInboxProjection.swift b/mailslurp/Models/OrganizationInboxProjection.swift new file mode 100644 index 00000000..e49ac665 --- /dev/null +++ b/mailslurp/Models/OrganizationInboxProjection.swift @@ -0,0 +1,87 @@ +// +// OrganizationInboxProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Organization team inbox */ +@objc public class OrganizationInboxProjection: NSObject, Codable { + + public enum InboxType: String, Codable, CaseIterable { + case httpInbox = "HTTP_INBOX" + case smtpInbox = "SMTP_INBOX" + } + /** ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically. */ + public var _id: UUID + /** ID of custom domain used by the inbox if any */ + public var domainId: UUID? + /** When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`. */ + public var createdAt: Date + /** Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search */ + public var name: String? + /** The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. */ + public var emailAddress: String? + /** Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering */ + public var favourite: Bool + /** Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. */ + public var tags: [String]? + /** Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/ */ + public var teamAccess: Bool + /** Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send). */ + public var inboxType: InboxType? + /** Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes. */ + public var readOnly: Bool + /** Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions. */ + public var virtualInbox: Bool + + public init(_id: UUID, domainId: UUID? = nil, createdAt: Date, name: String? = nil, emailAddress: String? = nil, favourite: Bool, tags: [String]? = nil, teamAccess: Bool, inboxType: InboxType? = nil, readOnly: Bool, virtualInbox: Bool) { + self._id = _id + self.domainId = domainId + self.createdAt = createdAt + self.name = name + self.emailAddress = emailAddress + self.favourite = favourite + self.tags = tags + self.teamAccess = teamAccess + self.inboxType = inboxType + self.readOnly = readOnly + self.virtualInbox = virtualInbox + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case domainId + case createdAt + case name + case emailAddress + case favourite + case tags + case teamAccess + case inboxType + case readOnly + case virtualInbox + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encode(createdAt, forKey: .createdAt) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(emailAddress, forKey: .emailAddress) + try container.encode(favourite, forKey: .favourite) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encode(teamAccess, forKey: .teamAccess) + try container.encodeIfPresent(inboxType, forKey: .inboxType) + try container.encode(readOnly, forKey: .readOnly) + try container.encode(virtualInbox, forKey: .virtualInbox) + } + + + +} diff --git a/mailslurp/Models/PageAlias.swift b/mailslurp/Models/PageAlias.swift new file mode 100644 index 00000000..3138680f --- /dev/null +++ b/mailslurp/Models/PageAlias.swift @@ -0,0 +1,121 @@ +// +// PageAlias.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated email alias results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageAlias: NSObject, Codable { + + public var content: [AliasProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [AliasProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageAttachmentEntity.swift b/mailslurp/Models/PageAttachmentEntity.swift new file mode 100644 index 00000000..d06da28f --- /dev/null +++ b/mailslurp/Models/PageAttachmentEntity.swift @@ -0,0 +1,121 @@ +// +// PageAttachmentEntity.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated attachment entity results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageAttachmentEntity: NSObject, Codable { + + public var content: [AttachmentProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [AttachmentProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageBouncedEmail.swift b/mailslurp/Models/PageBouncedEmail.swift new file mode 100644 index 00000000..3d7b03ae --- /dev/null +++ b/mailslurp/Models/PageBouncedEmail.swift @@ -0,0 +1,121 @@ +// +// PageBouncedEmail.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated bounced email. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageBouncedEmail: NSObject, Codable { + + public var content: [BounceProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [BounceProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageBouncedRecipients.swift b/mailslurp/Models/PageBouncedRecipients.swift new file mode 100644 index 00000000..b1ba6fa5 --- /dev/null +++ b/mailslurp/Models/PageBouncedRecipients.swift @@ -0,0 +1,121 @@ +// +// PageBouncedRecipients.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated bounced recipients. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageBouncedRecipients: NSObject, Codable { + + public var content: [BounceRecipientProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [BounceRecipientProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageComplaint.swift b/mailslurp/Models/PageComplaint.swift new file mode 100644 index 00000000..14b71a84 --- /dev/null +++ b/mailslurp/Models/PageComplaint.swift @@ -0,0 +1,121 @@ +// +// PageComplaint.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated complaint email. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageComplaint: NSObject, Codable { + + public var content: [Complaint]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [Complaint]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageContactProjection.swift b/mailslurp/Models/PageContactProjection.swift new file mode 100644 index 00000000..6d254244 --- /dev/null +++ b/mailslurp/Models/PageContactProjection.swift @@ -0,0 +1,121 @@ +// +// PageContactProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated contact results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageContactProjection: NSObject, Codable { + + public var content: [ContactProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [ContactProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageDeliveryStatus.swift b/mailslurp/Models/PageDeliveryStatus.swift new file mode 100644 index 00000000..c9b225f3 --- /dev/null +++ b/mailslurp/Models/PageDeliveryStatus.swift @@ -0,0 +1,121 @@ +// +// PageDeliveryStatus.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated delivery status results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageDeliveryStatus: NSObject, Codable { + + public var content: [DeliveryStatusDto]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [DeliveryStatusDto]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageEmailPreview.swift b/mailslurp/Models/PageEmailPreview.swift new file mode 100644 index 00000000..370f851e --- /dev/null +++ b/mailslurp/Models/PageEmailPreview.swift @@ -0,0 +1,121 @@ +// +// PageEmailPreview.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated email preview results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments. */ +@objc public class PageEmailPreview: NSObject, Codable { + + public var content: [EmailPreview]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [EmailPreview]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageEmailProjection.swift b/mailslurp/Models/PageEmailProjection.swift new file mode 100644 index 00000000..af72df6d --- /dev/null +++ b/mailslurp/Models/PageEmailProjection.swift @@ -0,0 +1,121 @@ +// +// PageEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments. */ +@objc public class PageEmailProjection: NSObject, Codable { + + public var content: [EmailProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [EmailProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageEmailValidationRequest.swift b/mailslurp/Models/PageEmailValidationRequest.swift new file mode 100644 index 00000000..3c6c8430 --- /dev/null +++ b/mailslurp/Models/PageEmailValidationRequest.swift @@ -0,0 +1,121 @@ +// +// PageEmailValidationRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated email validation request records. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageEmailValidationRequest: NSObject, Codable { + + public var content: [EmailValidationRequest]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [EmailValidationRequest]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageExpiredInboxRecordProjection.swift b/mailslurp/Models/PageExpiredInboxRecordProjection.swift new file mode 100644 index 00000000..abb69bff --- /dev/null +++ b/mailslurp/Models/PageExpiredInboxRecordProjection.swift @@ -0,0 +1,121 @@ +// +// PageExpiredInboxRecordProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated expired inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageExpiredInboxRecordProjection: NSObject, Codable { + + public var content: [ExpiredInboxRecordProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [ExpiredInboxRecordProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageGroupProjection.swift b/mailslurp/Models/PageGroupProjection.swift new file mode 100644 index 00000000..4969a6b7 --- /dev/null +++ b/mailslurp/Models/PageGroupProjection.swift @@ -0,0 +1,121 @@ +// +// PageGroupProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated missed email results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageGroupProjection: NSObject, Codable { + + public var content: [GroupProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [GroupProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageInboxForwarderDto.swift b/mailslurp/Models/PageInboxForwarderDto.swift new file mode 100644 index 00000000..debaf978 --- /dev/null +++ b/mailslurp/Models/PageInboxForwarderDto.swift @@ -0,0 +1,121 @@ +// +// PageInboxForwarderDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated inbox forwarder results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageInboxForwarderDto: NSObject, Codable { + + public var content: [InboxForwarderDto]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [InboxForwarderDto]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageInboxProjection.swift b/mailslurp/Models/PageInboxProjection.swift new file mode 100644 index 00000000..80e46a65 --- /dev/null +++ b/mailslurp/Models/PageInboxProjection.swift @@ -0,0 +1,121 @@ +// +// PageInboxProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageInboxProjection: NSObject, Codable { + + public var content: [InboxPreview]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [InboxPreview]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageInboxRulesetDto.swift b/mailslurp/Models/PageInboxRulesetDto.swift new file mode 100644 index 00000000..8ecc1db1 --- /dev/null +++ b/mailslurp/Models/PageInboxRulesetDto.swift @@ -0,0 +1,121 @@ +// +// PageInboxRulesetDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated inbox ruleset results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageInboxRulesetDto: NSObject, Codable { + + public var content: [InboxRulesetDto]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [InboxRulesetDto]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageMissedEmailProjection.swift b/mailslurp/Models/PageMissedEmailProjection.swift new file mode 100644 index 00000000..abe1bcf6 --- /dev/null +++ b/mailslurp/Models/PageMissedEmailProjection.swift @@ -0,0 +1,121 @@ +// +// PageMissedEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated MissedEmail results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageMissedEmailProjection: NSObject, Codable { + + public var content: [MissedEmailProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [MissedEmailProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageOrganizationInboxProjection.swift b/mailslurp/Models/PageOrganizationInboxProjection.swift new file mode 100644 index 00000000..f4c1cdab --- /dev/null +++ b/mailslurp/Models/PageOrganizationInboxProjection.swift @@ -0,0 +1,121 @@ +// +// PageOrganizationInboxProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated organization inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageOrganizationInboxProjection: NSObject, Codable { + + public var content: [OrganizationInboxProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [OrganizationInboxProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PagePhoneNumberProjection.swift b/mailslurp/Models/PagePhoneNumberProjection.swift new file mode 100644 index 00000000..36b5f223 --- /dev/null +++ b/mailslurp/Models/PagePhoneNumberProjection.swift @@ -0,0 +1,121 @@ +// +// PagePhoneNumberProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated phone numbers. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PagePhoneNumberProjection: NSObject, Codable { + + public var content: [PhoneNumberProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [PhoneNumberProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageSentEmailProjection.swift b/mailslurp/Models/PageSentEmailProjection.swift new file mode 100644 index 00000000..f0bbe1a1 --- /dev/null +++ b/mailslurp/Models/PageSentEmailProjection.swift @@ -0,0 +1,102 @@ +// +// PageSentEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated sent email results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full sent email entity use the projection ID with individual method calls. */ +@objc public class PageSentEmailProjection: NSObject, Codable { + + /** Collection of items */ + public var content: [SentEmailProjection] + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + /** Size of page requested */ + public var size: Int + /** Page number starting at 0 */ + public var number: Int + /** Number of items returned */ + public var numberOfElements: Int + /** Total number of items available for querying */ + public var totalElements: Int64 + /** Total number of pages available */ + public var totalPages: Int + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [SentEmailProjection], pageable: PageableObject? = nil, total: Int64? = nil, size: Int, number: Int, numberOfElements: Int, totalElements: Int64, totalPages: Int, last: Bool? = nil, sort: Sort? = nil, first: Bool? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.size = size + self.number = number + self.numberOfElements = numberOfElements + self.totalElements = totalElements + self.totalPages = totalPages + self.last = last + self.sort = sort + self.first = first + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case size + case number + case numberOfElements + case totalElements + case totalPages + case last + case sort + case first + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encode(size, forKey: .size) + try container.encode(number, forKey: .number) + try container.encode(numberOfElements, forKey: .numberOfElements) + try container.encode(totalElements, forKey: .totalElements) + try container.encode(totalPages, forKey: .totalPages) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageSentEmailWithQueueProjection.swift b/mailslurp/Models/PageSentEmailWithQueueProjection.swift new file mode 100644 index 00000000..f0d2cc2d --- /dev/null +++ b/mailslurp/Models/PageSentEmailWithQueueProjection.swift @@ -0,0 +1,102 @@ +// +// PageSentEmailWithQueueProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated sent email results for emails sent with queue. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full sent email entity use the projection ID with individual method calls. */ +@objc public class PageSentEmailWithQueueProjection: NSObject, Codable { + + /** Collection of items */ + public var content: [SendWithQueueResult] + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + /** Size of page requested */ + public var size: Int + /** Page number starting at 0 */ + public var number: Int + /** Number of items returned */ + public var numberOfElements: Int + /** Total number of items available for querying */ + public var totalElements: Int64 + /** Total number of pages available */ + public var totalPages: Int + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [SendWithQueueResult], pageable: PageableObject? = nil, total: Int64? = nil, size: Int, number: Int, numberOfElements: Int, totalElements: Int64, totalPages: Int, last: Bool? = nil, sort: Sort? = nil, first: Bool? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.size = size + self.number = number + self.numberOfElements = numberOfElements + self.totalElements = totalElements + self.totalPages = totalPages + self.last = last + self.sort = sort + self.first = first + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case size + case number + case numberOfElements + case totalElements + case totalPages + case last + case sort + case first + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encode(size, forKey: .size) + try container.encode(number, forKey: .number) + try container.encode(numberOfElements, forKey: .numberOfElements) + try container.encode(totalElements, forKey: .totalElements) + try container.encode(totalPages, forKey: .totalPages) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageSmsProjection.swift b/mailslurp/Models/PageSmsProjection.swift new file mode 100644 index 00000000..e3817939 --- /dev/null +++ b/mailslurp/Models/PageSmsProjection.swift @@ -0,0 +1,121 @@ +// +// PageSmsProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated SMS messages. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageSmsProjection: NSObject, Codable { + + public var content: [SmsProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [SmsProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageTemplateProjection.swift b/mailslurp/Models/PageTemplateProjection.swift new file mode 100644 index 00000000..b62f9ab7 --- /dev/null +++ b/mailslurp/Models/PageTemplateProjection.swift @@ -0,0 +1,121 @@ +// +// PageTemplateProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated email template results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageTemplateProjection: NSObject, Codable { + + public var content: [TemplateProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [TemplateProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageThreadProjection.swift b/mailslurp/Models/PageThreadProjection.swift new file mode 100644 index 00000000..92c7345f --- /dev/null +++ b/mailslurp/Models/PageThreadProjection.swift @@ -0,0 +1,121 @@ +// +// PageThreadProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments. */ +@objc public class PageThreadProjection: NSObject, Codable { + + public var content: [ThreadProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [ThreadProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageTrackingPixelProjection.swift b/mailslurp/Models/PageTrackingPixelProjection.swift new file mode 100644 index 00000000..e56806ce --- /dev/null +++ b/mailslurp/Models/PageTrackingPixelProjection.swift @@ -0,0 +1,121 @@ +// +// PageTrackingPixelProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated TrackingPixel results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageTrackingPixelProjection: NSObject, Codable { + + public var content: [TrackingPixelProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [TrackingPixelProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageUnknownMissedEmailProjection.swift b/mailslurp/Models/PageUnknownMissedEmailProjection.swift new file mode 100644 index 00000000..66aaaecb --- /dev/null +++ b/mailslurp/Models/PageUnknownMissedEmailProjection.swift @@ -0,0 +1,121 @@ +// +// PageUnknownMissedEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated unknown MissedEmail results. Unknown missed emails are emails that were sent to MailSlurp /Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageUnknownMissedEmailProjection: NSObject, Codable { + + public var content: [UnknownMissedEmailProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [UnknownMissedEmailProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageWebhookProjection.swift b/mailslurp/Models/PageWebhookProjection.swift new file mode 100644 index 00000000..8365508b --- /dev/null +++ b/mailslurp/Models/PageWebhookProjection.swift @@ -0,0 +1,121 @@ +// +// PageWebhookProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated webhook entity. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageWebhookProjection: NSObject, Codable { + + public var content: [WebhookProjection]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [WebhookProjection]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageWebhookResult.swift b/mailslurp/Models/PageWebhookResult.swift new file mode 100644 index 00000000..db6c01cd --- /dev/null +++ b/mailslurp/Models/PageWebhookResult.swift @@ -0,0 +1,121 @@ +// +// PageWebhookResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Paginated webhook results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. */ +@objc public class PageWebhookResult: NSObject, Codable { + + public var content: [WebhookResultDto]? + public var pageable: PageableObject? + public var total: Int64? + public var totalNum: NSNumber? { + get { + return total as NSNumber? + } + } + public var last: Bool? + public var lastNum: NSNumber? { + get { + return last as NSNumber? + } + } + public var totalElements: Int64? + public var totalElementsNum: NSNumber? { + get { + return totalElements as NSNumber? + } + } + public var totalPages: Int? + public var totalPagesNum: NSNumber? { + get { + return totalPages as NSNumber? + } + } + public var size: Int? + public var sizeNum: NSNumber? { + get { + return size as NSNumber? + } + } + public var number: Int? + public var numberNum: NSNumber? { + get { + return number as NSNumber? + } + } + public var sort: Sort? + public var first: Bool? + public var firstNum: NSNumber? { + get { + return first as NSNumber? + } + } + public var numberOfElements: Int? + public var numberOfElementsNum: NSNumber? { + get { + return numberOfElements as NSNumber? + } + } + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + + public init(content: [WebhookResultDto]? = nil, pageable: PageableObject? = nil, total: Int64? = nil, last: Bool? = nil, totalElements: Int64? = nil, totalPages: Int? = nil, size: Int? = nil, number: Int? = nil, sort: Sort? = nil, first: Bool? = nil, numberOfElements: Int? = nil, empty: Bool? = nil) { + self.content = content + self.pageable = pageable + self.total = total + self.last = last + self.totalElements = totalElements + self.totalPages = totalPages + self.size = size + self.number = number + self.sort = sort + self.first = first + self.numberOfElements = numberOfElements + self.empty = empty + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + case pageable + case total + case last + case totalElements + case totalPages + case size + case number + case sort + case first + case numberOfElements + case empty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(content, forKey: .content) + try container.encodeIfPresent(pageable, forKey: .pageable) + try container.encodeIfPresent(total, forKey: .total) + try container.encodeIfPresent(last, forKey: .last) + try container.encodeIfPresent(totalElements, forKey: .totalElements) + try container.encodeIfPresent(totalPages, forKey: .totalPages) + try container.encodeIfPresent(size, forKey: .size) + try container.encodeIfPresent(number, forKey: .number) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(first, forKey: .first) + try container.encodeIfPresent(numberOfElements, forKey: .numberOfElements) + try container.encodeIfPresent(empty, forKey: .empty) + } + + + +} diff --git a/mailslurp/Models/PageableObject.swift b/mailslurp/Models/PageableObject.swift new file mode 100644 index 00000000..249362f6 --- /dev/null +++ b/mailslurp/Models/PageableObject.swift @@ -0,0 +1,76 @@ +// +// PageableObject.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class PageableObject: NSObject, Codable { + + public var offset: Int64? + public var offsetNum: NSNumber? { + get { + return offset as NSNumber? + } + } + public var sort: Sort? + public var pageNumber: Int? + public var pageNumberNum: NSNumber? { + get { + return pageNumber as NSNumber? + } + } + public var pageSize: Int? + public var pageSizeNum: NSNumber? { + get { + return pageSize as NSNumber? + } + } + public var paged: Bool? + public var pagedNum: NSNumber? { + get { + return paged as NSNumber? + } + } + public var unpaged: Bool? + public var unpagedNum: NSNumber? { + get { + return unpaged as NSNumber? + } + } + + public init(offset: Int64? = nil, sort: Sort? = nil, pageNumber: Int? = nil, pageSize: Int? = nil, paged: Bool? = nil, unpaged: Bool? = nil) { + self.offset = offset + self.sort = sort + self.pageNumber = pageNumber + self.pageSize = pageSize + self.paged = paged + self.unpaged = unpaged + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case offset + case sort + case pageNumber + case pageSize + case paged + case unpaged + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(offset, forKey: .offset) + try container.encodeIfPresent(sort, forKey: .sort) + try container.encodeIfPresent(pageNumber, forKey: .pageNumber) + try container.encodeIfPresent(pageSize, forKey: .pageSize) + try container.encodeIfPresent(paged, forKey: .paged) + try container.encodeIfPresent(unpaged, forKey: .unpaged) + } + + + +} diff --git a/mailslurp/Models/PhoneNumberDto.swift b/mailslurp/Models/PhoneNumberDto.swift new file mode 100644 index 00000000..95c45d02 --- /dev/null +++ b/mailslurp/Models/PhoneNumberDto.swift @@ -0,0 +1,67 @@ +// +// PhoneNumberDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class PhoneNumberDto: NSObject, Codable { + + public enum PhoneCountry: String, Codable, CaseIterable { + case us = "US" + case gb = "GB" + } + public var _id: UUID + public var userId: UUID + public var complianceAddress: UUID? + public var emergencyAddress: UUID? + public var phoneNumber: String + public var phoneCountry: PhoneCountry + public var phonePlan: UUID + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID, userId: UUID, complianceAddress: UUID? = nil, emergencyAddress: UUID? = nil, phoneNumber: String, phoneCountry: PhoneCountry, phonePlan: UUID, createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.complianceAddress = complianceAddress + self.emergencyAddress = emergencyAddress + self.phoneNumber = phoneNumber + self.phoneCountry = phoneCountry + self.phonePlan = phonePlan + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case complianceAddress + case emergencyAddress + case phoneNumber + case phoneCountry + case phonePlan + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(complianceAddress, forKey: .complianceAddress) + try container.encodeIfPresent(emergencyAddress, forKey: .emergencyAddress) + try container.encode(phoneNumber, forKey: .phoneNumber) + try container.encode(phoneCountry, forKey: .phoneCountry) + try container.encode(phonePlan, forKey: .phonePlan) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/PhoneNumberProjection.swift b/mailslurp/Models/PhoneNumberProjection.swift new file mode 100644 index 00000000..592cb78f --- /dev/null +++ b/mailslurp/Models/PhoneNumberProjection.swift @@ -0,0 +1,52 @@ +// +// PhoneNumberProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Phone number projection */ +@objc public class PhoneNumberProjection: NSObject, Codable { + + public enum PhoneCountry: String, Codable, CaseIterable { + case us = "US" + case gb = "GB" + } + public var _id: UUID + public var userId: UUID + public var phoneNumber: String + public var phoneCountry: PhoneCountry + public var createdAt: Date + + public init(_id: UUID, userId: UUID, phoneNumber: String, phoneCountry: PhoneCountry, createdAt: Date) { + self._id = _id + self.userId = userId + self.phoneNumber = phoneNumber + self.phoneCountry = phoneCountry + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case phoneNumber + case phoneCountry + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(phoneNumber, forKey: .phoneNumber) + try container.encode(phoneCountry, forKey: .phoneCountry) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/PhonePlanDto.swift b/mailslurp/Models/PhonePlanDto.swift new file mode 100644 index 00000000..369574d3 --- /dev/null +++ b/mailslurp/Models/PhonePlanDto.swift @@ -0,0 +1,47 @@ +// +// PhonePlanDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class PhonePlanDto: NSObject, Codable { + + public enum PhoneCountry: String, Codable, CaseIterable { + case us = "US" + case gb = "GB" + } + public var _id: UUID + public var userId: UUID + public var phoneCountry: PhoneCountry + public var createdAt: Date + + public init(_id: UUID, userId: UUID, phoneCountry: PhoneCountry, createdAt: Date) { + self._id = _id + self.userId = userId + self.phoneCountry = phoneCountry + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case phoneCountry + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(phoneCountry, forKey: .phoneCountry) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/RawEmailJson.swift b/mailslurp/Models/RawEmailJson.swift new file mode 100644 index 00000000..493edc73 --- /dev/null +++ b/mailslurp/Models/RawEmailJson.swift @@ -0,0 +1,32 @@ +// +// RawEmailJson.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Content in raw format */ +@objc public class RawEmailJson: NSObject, Codable { + + public var content: String + + public init(content: String) { + self.content = content + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case content + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(content, forKey: .content) + } + + + +} diff --git a/mailslurp/Models/Recipient.swift b/mailslurp/Models/Recipient.swift new file mode 100644 index 00000000..64c3b05f --- /dev/null +++ b/mailslurp/Models/Recipient.swift @@ -0,0 +1,40 @@ +// +// Recipient.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email recipient */ +@objc public class Recipient: NSObject, Codable { + + public var rawValue: String + public var emailAddress: String + public var name: String? + + public init(rawValue: String, emailAddress: String, name: String? = nil) { + self.rawValue = rawValue + self.emailAddress = emailAddress + self.name = name + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case rawValue + case emailAddress + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(rawValue, forKey: .rawValue) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(name, forKey: .name) + } + + + +} diff --git a/mailslurp/Models/ReplyToAliasEmailOptions.swift b/mailslurp/Models/ReplyToAliasEmailOptions.swift new file mode 100644 index 00000000..597c7970 --- /dev/null +++ b/mailslurp/Models/ReplyToAliasEmailOptions.swift @@ -0,0 +1,85 @@ +// +// ReplyToAliasEmailOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for replying to an alias email using the alias inbox */ +@objc public class ReplyToAliasEmailOptions: NSObject, Codable { + + public enum SendStrategy: String, Codable, CaseIterable { + case singleMessage = "SINGLE_MESSAGE" + } + /** Body of the reply email you want to send */ + public var body: String + /** Is the reply HTML */ + public var isHTML: Bool + /** The charset that your message should be sent with. Optional. Default is UTF-8 */ + public var charset: String? + /** List of uploaded attachments to send with the reply. Optional. */ + public var attachments: [String]? + /** Template variables if using a template */ + public var templateVariables: [String: AnyCodable]? + /** Template ID to use instead of body. Will use template variable map to fill defined variable slots. */ + public var template: UUID? + /** How an email should be sent based on its recipients */ + public var sendStrategy: SendStrategy? + /** Optionally use inbox name as display name for sender email address */ + public var useInboxName: Bool? + public var useInboxNameNum: NSNumber? { + get { + return useInboxName as NSNumber? + } + } + public var html: Bool? + public var htmlNum: NSNumber? { + get { + return html as NSNumber? + } + } + + public init(body: String, isHTML: Bool, charset: String? = nil, attachments: [String]? = nil, templateVariables: [String: AnyCodable]? = nil, template: UUID? = nil, sendStrategy: SendStrategy? = nil, useInboxName: Bool? = nil, html: Bool? = nil) { + self.body = body + self.isHTML = isHTML + self.charset = charset + self.attachments = attachments + self.templateVariables = templateVariables + self.template = template + self.sendStrategy = sendStrategy + self.useInboxName = useInboxName + self.html = html + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case body + case isHTML + case charset + case attachments + case templateVariables + case template + case sendStrategy + case useInboxName + case html + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(body, forKey: .body) + try container.encode(isHTML, forKey: .isHTML) + try container.encodeIfPresent(charset, forKey: .charset) + try container.encodeIfPresent(attachments, forKey: .attachments) + try container.encodeIfPresent(templateVariables, forKey: .templateVariables) + try container.encodeIfPresent(template, forKey: .template) + try container.encodeIfPresent(sendStrategy, forKey: .sendStrategy) + try container.encodeIfPresent(useInboxName, forKey: .useInboxName) + try container.encodeIfPresent(html, forKey: .html) + } + + + +} diff --git a/mailslurp/Models/ReplyToEmailOptions.swift b/mailslurp/Models/ReplyToEmailOptions.swift new file mode 100644 index 00000000..8d1d11e4 --- /dev/null +++ b/mailslurp/Models/ReplyToEmailOptions.swift @@ -0,0 +1,95 @@ +// +// ReplyToEmailOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for replying to email with API */ +@objc public class ReplyToEmailOptions: NSObject, Codable { + + public enum SendStrategy: String, Codable, CaseIterable { + case singleMessage = "SINGLE_MESSAGE" + } + /** Body of the reply email you want to send */ + public var body: String + /** Is the reply HTML */ + public var isHTML: Bool + /** The from header that should be used. Optional */ + public var from: String? + /** The replyTo header that should be used. Optional */ + public var replyTo: String? + /** The charset that your message should be sent with. Optional. Default is UTF-8 */ + public var charset: String? + /** List of uploaded attachments to send with the reply. Optional. */ + public var attachments: [String]? + /** Template variables if using a template */ + public var templateVariables: [String: AnyCodable]? + /** Template ID to use instead of body. Will use template variable map to fill defined variable slots. */ + public var template: UUID? + /** How an email should be sent based on its recipients */ + public var sendStrategy: SendStrategy? + /** Optionally use inbox name as display name for sender email address */ + public var useInboxName: Bool? + public var useInboxNameNum: NSNumber? { + get { + return useInboxName as NSNumber? + } + } + public var html: Bool? + public var htmlNum: NSNumber? { + get { + return html as NSNumber? + } + } + + public init(body: String, isHTML: Bool, from: String? = nil, replyTo: String? = nil, charset: String? = nil, attachments: [String]? = nil, templateVariables: [String: AnyCodable]? = nil, template: UUID? = nil, sendStrategy: SendStrategy? = nil, useInboxName: Bool? = nil, html: Bool? = nil) { + self.body = body + self.isHTML = isHTML + self.from = from + self.replyTo = replyTo + self.charset = charset + self.attachments = attachments + self.templateVariables = templateVariables + self.template = template + self.sendStrategy = sendStrategy + self.useInboxName = useInboxName + self.html = html + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case body + case isHTML + case from + case replyTo + case charset + case attachments + case templateVariables + case template + case sendStrategy + case useInboxName + case html + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(body, forKey: .body) + try container.encode(isHTML, forKey: .isHTML) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(replyTo, forKey: .replyTo) + try container.encodeIfPresent(charset, forKey: .charset) + try container.encodeIfPresent(attachments, forKey: .attachments) + try container.encodeIfPresent(templateVariables, forKey: .templateVariables) + try container.encodeIfPresent(template, forKey: .template) + try container.encodeIfPresent(sendStrategy, forKey: .sendStrategy) + try container.encodeIfPresent(useInboxName, forKey: .useInboxName) + try container.encodeIfPresent(html, forKey: .html) + } + + + +} diff --git a/mailslurp/Models/SendEmailOptions.swift b/mailslurp/Models/SendEmailOptions.swift new file mode 100644 index 00000000..0229aa5a --- /dev/null +++ b/mailslurp/Models/SendEmailOptions.swift @@ -0,0 +1,161 @@ +// +// SendEmailOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for the email to be sent */ +@objc public class SendEmailOptions: NSObject, Codable { + + public enum SendStrategy: String, Codable, CaseIterable { + case singleMessage = "SINGLE_MESSAGE" + } + public enum ValidateEmailAddresses: String, Codable, CaseIterable { + case validateFilterRemoveInvalid = "VALIDATE_FILTER_REMOVE_INVALID" + case validateErrorIfInvalid = "VALIDATE_ERROR_IF_INVALID" + case noValidation = "NO_VALIDATION" + } + /** Optional list of contact IDs to send email to. Manage your contacts via the API or dashboard. When contacts are used the email is sent to each contact separately so they will not see other recipients. */ + public var toContacts: [UUID]? + /** Optional contact group ID to send email to. You can create contacts and contact groups in the API or dashboard and use them for email campaigns. When contact groups are used the email is sent to each contact separately so they will not see other recipients */ + public var toGroup: UUID? + /** List of destination email addresses. Each email address must be RFC 5322 format. Even single recipients must be in array form. Maximum recipients per email depends on your plan. If you need to send many emails try using contacts or contact groups or use a non standard sendStrategy to ensure that spam filters are not triggered (many recipients in one email can affect your spam rating). Be cautious when sending emails that your recipients exist. High bounce rates (meaning a high percentage of emails cannot be delivered because an address does not exist) can result in account freezing. */ + public var to: [String]? + /** Optional from address. Email address is RFC 5322 format and may include a display name and email in angle brackets (`my@address.com` or `My inbox <my@address.com>`). If no sender is set the source inbox address will be used for this field. If you set `useInboxName` to `true` the from field will include the inbox name as a display name: `inbox_name <inbox@address.com>`. For this to work use the name field when creating an inbox. Beware of potential spam penalties when setting the from field to an address not used by the inbox. Your emails may get blocked by services if you impersonate another address. To use a custom email addresses use a custom domain. You can create domains with the DomainController. The domain must be verified in the dashboard before it can be used. */ + public var from: String? + /** Optional list of cc destination email addresses */ + public var cc: [String]? + /** Optional list of bcc destination email addresses */ + public var bcc: [String]? + /** Optional email subject line */ + public var subject: String? + /** Optional replyTo header */ + public var replyTo: String? + /** Optional contents of email. If body contains HTML then set `isHTML` to true to ensure that email clients render it correctly. You can use moustache template syntax in the email body in conjunction with `toGroup` contact variables or `templateVariables` data. If you need more templating control consider creating a template and using the `template` property instead of the body. */ + public var body: String? + /** Optional HTML flag to indicate that contents is HTML. Set's a `content-type: text/html` for email. (Deprecated: use `isHTML` instead.) */ + public var html: Bool? + public var htmlNum: NSNumber? { + get { + return html as NSNumber? + } + } + /** Optional HTML flag. If true the `content-type` of the email will be `text/html`. Set to true when sending HTML to ensure proper rending on email clients */ + public var isHTML: Bool? + public var isHTMLNum: NSNumber? { + get { + return isHTML as NSNumber? + } + } + /** Optional charset */ + public var charset: String? + /** Optional list of attachment IDs to send with this email. You must first upload each attachment separately via method call or dashboard in order to obtain attachment IDs. This way you can reuse attachments with different emails once uploaded. There are several ways to upload that support `multi-part form`, `base64 file encoding`, and octet stream binary uploads. See the `UploadController` for available methods. */ + public var attachments: [String]? + /** Optional map of template variables. Will replace moustache syntax variables in subject and body or template with the associated values if found. */ + public var templateVariables: [String: AnyCodable]? + /** Optional template ID to use for body. Will override body if provided. When using a template make sure you pass the corresponding map of `templateVariables`. You can find which variables are needed by fetching the template itself or viewing it in the dashboard. */ + public var template: UUID? + /** How an email should be sent based on its recipients */ + public var sendStrategy: SendStrategy? + /** Use name of inbox as sender email address name. Will construct RFC 5322 email address with `Inbox name <inbox@address.com>` if the inbox has a name. */ + public var useInboxName: Bool? + public var useInboxNameNum: NSNumber? { + get { + return useInboxName as NSNumber? + } + } + /** Add tracking pixel to email */ + public var addTrackingPixel: Bool? + public var addTrackingPixelNum: NSNumber? { + get { + return addTrackingPixel as NSNumber? + } + } + /** Filter recipients to remove any bounced recipients from to, bcc, and cc before sending */ + public var filterBouncedRecipients: Bool? + public var filterBouncedRecipientsNum: NSNumber? { + get { + return filterBouncedRecipients as NSNumber? + } + } + /** Validate recipient email addresses before sending */ + public var validateEmailAddresses: ValidateEmailAddresses? + + public init(toContacts: [UUID]? = nil, toGroup: UUID? = nil, to: [String]? = nil, from: String? = nil, cc: [String]? = nil, bcc: [String]? = nil, subject: String? = nil, replyTo: String? = nil, body: String? = nil, html: Bool? = nil, isHTML: Bool? = nil, charset: String? = nil, attachments: [String]? = nil, templateVariables: [String: AnyCodable]? = nil, template: UUID? = nil, sendStrategy: SendStrategy? = nil, useInboxName: Bool? = nil, addTrackingPixel: Bool? = nil, filterBouncedRecipients: Bool? = nil, validateEmailAddresses: ValidateEmailAddresses? = nil) { + self.toContacts = toContacts + self.toGroup = toGroup + self.to = to + self.from = from + self.cc = cc + self.bcc = bcc + self.subject = subject + self.replyTo = replyTo + self.body = body + self.html = html + self.isHTML = isHTML + self.charset = charset + self.attachments = attachments + self.templateVariables = templateVariables + self.template = template + self.sendStrategy = sendStrategy + self.useInboxName = useInboxName + self.addTrackingPixel = addTrackingPixel + self.filterBouncedRecipients = filterBouncedRecipients + self.validateEmailAddresses = validateEmailAddresses + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case toContacts + case toGroup + case to + case from + case cc + case bcc + case subject + case replyTo + case body + case html + case isHTML + case charset + case attachments + case templateVariables + case template + case sendStrategy + case useInboxName + case addTrackingPixel + case filterBouncedRecipients + case validateEmailAddresses + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(toContacts, forKey: .toContacts) + try container.encodeIfPresent(toGroup, forKey: .toGroup) + try container.encodeIfPresent(to, forKey: .to) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(replyTo, forKey: .replyTo) + try container.encodeIfPresent(body, forKey: .body) + try container.encodeIfPresent(html, forKey: .html) + try container.encodeIfPresent(isHTML, forKey: .isHTML) + try container.encodeIfPresent(charset, forKey: .charset) + try container.encodeIfPresent(attachments, forKey: .attachments) + try container.encodeIfPresent(templateVariables, forKey: .templateVariables) + try container.encodeIfPresent(template, forKey: .template) + try container.encodeIfPresent(sendStrategy, forKey: .sendStrategy) + try container.encodeIfPresent(useInboxName, forKey: .useInboxName) + try container.encodeIfPresent(addTrackingPixel, forKey: .addTrackingPixel) + try container.encodeIfPresent(filterBouncedRecipients, forKey: .filterBouncedRecipients) + try container.encodeIfPresent(validateEmailAddresses, forKey: .validateEmailAddresses) + } + + + +} diff --git a/mailslurp/Models/SendSMTPEnvelopeOptions.swift b/mailslurp/Models/SendSMTPEnvelopeOptions.swift new file mode 100644 index 00000000..2c579447 --- /dev/null +++ b/mailslurp/Models/SendSMTPEnvelopeOptions.swift @@ -0,0 +1,40 @@ +// +// SendSMTPEnvelopeOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for the email envelope */ +@objc public class SendSMTPEnvelopeOptions: NSObject, Codable { + + public var rcptTo: [String] + public var mailFrom: String + public var data: String + + public init(rcptTo: [String], mailFrom: String, data: String) { + self.rcptTo = rcptTo + self.mailFrom = mailFrom + self.data = data + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case rcptTo + case mailFrom + case data + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(rcptTo, forKey: .rcptTo) + try container.encode(mailFrom, forKey: .mailFrom) + try container.encode(data, forKey: .data) + } + + + +} diff --git a/mailslurp/Models/SendWithQueueResult.swift b/mailslurp/Models/SendWithQueueResult.swift new file mode 100644 index 00000000..fca7c3d7 --- /dev/null +++ b/mailslurp/Models/SendWithQueueResult.swift @@ -0,0 +1,68 @@ +// +// SendWithQueueResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Collection of items */ +@objc public class SendWithQueueResult: NSObject, Codable { + + public var _id: UUID + public var userId: UUID + public var subject: String? + public var inboxId: UUID? + public var headerId: String + public var delivered: Bool + public var exceptionName: String? + public var message: String? + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID, userId: UUID, subject: String? = nil, inboxId: UUID? = nil, headerId: String, delivered: Bool, exceptionName: String? = nil, message: String? = nil, createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.subject = subject + self.inboxId = inboxId + self.headerId = headerId + self.delivered = delivered + self.exceptionName = exceptionName + self.message = message + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case subject + case inboxId + case headerId + case delivered + case exceptionName + case message + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encode(headerId, forKey: .headerId) + try container.encode(delivered, forKey: .delivered) + try container.encodeIfPresent(exceptionName, forKey: .exceptionName) + try container.encodeIfPresent(message, forKey: .message) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/Sender.swift b/mailslurp/Models/Sender.swift new file mode 100644 index 00000000..0e7b3df9 --- /dev/null +++ b/mailslurp/Models/Sender.swift @@ -0,0 +1,40 @@ +// +// Sender.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Sender object containing from email address and from personal name if provided in address */ +@objc public class Sender: NSObject, Codable { + + public var rawValue: String + public var emailAddress: String + public var name: String? + + public init(rawValue: String, emailAddress: String, name: String? = nil) { + self.rawValue = rawValue + self.emailAddress = emailAddress + self.name = name + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case rawValue + case emailAddress + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(rawValue, forKey: .rawValue) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(name, forKey: .name) + } + + + +} diff --git a/mailslurp/Models/SentEmailDto.swift b/mailslurp/Models/SentEmailDto.swift new file mode 100644 index 00000000..285f9425 --- /dev/null +++ b/mailslurp/Models/SentEmailDto.swift @@ -0,0 +1,150 @@ +// +// SentEmailDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Sent email details */ +@objc public class SentEmailDto: NSObject, Codable { + + /** ID of sent email */ + public var _id: UUID + /** User ID */ + public var userId: UUID + /** Inbox ID email was sent from */ + public var inboxId: UUID + /** Domain ID */ + public var domainId: UUID? + /** Recipients email was sent to */ + public var to: [String]? + public var from: String? + public var replyTo: String? + public var cc: [String]? + public var bcc: [String]? + /** Array of IDs of attachments that were sent with this email */ + public var attachments: [String]? + public var subject: String? + /** MD5 Hash */ + public var bodyMD5Hash: String? + public var body: String? + public var toContacts: [UUID]? + public var toGroup: UUID? + public var charset: String? + public var isHTML: Bool? + public var isHTMLNum: NSNumber? { + get { + return isHTML as NSNumber? + } + } + public var sentAt: Date + public var pixelIds: [UUID]? + public var messageId: String? + public var messageIds: [String]? + public var virtualSend: Bool? + public var virtualSendNum: NSNumber? { + get { + return virtualSend as NSNumber? + } + } + public var templateId: UUID? + public var templateVariables: [String: AnyCodable]? + public var html: Bool? + public var htmlNum: NSNumber? { + get { + return html as NSNumber? + } + } + + public init(_id: UUID, userId: UUID, inboxId: UUID, domainId: UUID? = nil, to: [String]? = nil, from: String? = nil, replyTo: String? = nil, cc: [String]? = nil, bcc: [String]? = nil, attachments: [String]? = nil, subject: String? = nil, bodyMD5Hash: String? = nil, body: String? = nil, toContacts: [UUID]? = nil, toGroup: UUID? = nil, charset: String? = nil, isHTML: Bool? = nil, sentAt: Date, pixelIds: [UUID]? = nil, messageId: String? = nil, messageIds: [String]? = nil, virtualSend: Bool? = nil, templateId: UUID? = nil, templateVariables: [String: AnyCodable]? = nil, html: Bool? = nil) { + self._id = _id + self.userId = userId + self.inboxId = inboxId + self.domainId = domainId + self.to = to + self.from = from + self.replyTo = replyTo + self.cc = cc + self.bcc = bcc + self.attachments = attachments + self.subject = subject + self.bodyMD5Hash = bodyMD5Hash + self.body = body + self.toContacts = toContacts + self.toGroup = toGroup + self.charset = charset + self.isHTML = isHTML + self.sentAt = sentAt + self.pixelIds = pixelIds + self.messageId = messageId + self.messageIds = messageIds + self.virtualSend = virtualSend + self.templateId = templateId + self.templateVariables = templateVariables + self.html = html + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case inboxId + case domainId + case to + case from + case replyTo + case cc + case bcc + case attachments + case subject + case bodyMD5Hash + case body + case toContacts + case toGroup + case charset + case isHTML + case sentAt + case pixelIds + case messageId + case messageIds + case virtualSend + case templateId + case templateVariables + case html + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(inboxId, forKey: .inboxId) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encodeIfPresent(to, forKey: .to) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(replyTo, forKey: .replyTo) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(attachments, forKey: .attachments) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(bodyMD5Hash, forKey: .bodyMD5Hash) + try container.encodeIfPresent(body, forKey: .body) + try container.encodeIfPresent(toContacts, forKey: .toContacts) + try container.encodeIfPresent(toGroup, forKey: .toGroup) + try container.encodeIfPresent(charset, forKey: .charset) + try container.encodeIfPresent(isHTML, forKey: .isHTML) + try container.encode(sentAt, forKey: .sentAt) + try container.encodeIfPresent(pixelIds, forKey: .pixelIds) + try container.encodeIfPresent(messageId, forKey: .messageId) + try container.encodeIfPresent(messageIds, forKey: .messageIds) + try container.encodeIfPresent(virtualSend, forKey: .virtualSend) + try container.encodeIfPresent(templateId, forKey: .templateId) + try container.encodeIfPresent(templateVariables, forKey: .templateVariables) + try container.encodeIfPresent(html, forKey: .html) + } + + + +} diff --git a/mailslurp/Models/SentEmailProjection.swift b/mailslurp/Models/SentEmailProjection.swift new file mode 100644 index 00000000..05a4a09e --- /dev/null +++ b/mailslurp/Models/SentEmailProjection.swift @@ -0,0 +1,76 @@ +// +// SentEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Collection of items */ +@objc public class SentEmailProjection: NSObject, Codable { + + public var _id: UUID + public var from: String? + public var userId: UUID + public var subject: String? + public var attachments: [String] + public var inboxId: UUID + public var to: [String] + public var createdAt: Date + public var bcc: [String] + public var cc: [String] + public var bodyMD5Hash: String? + public var virtualSend: Bool + + public init(_id: UUID, from: String? = nil, userId: UUID, subject: String? = nil, attachments: [String], inboxId: UUID, to: [String], createdAt: Date, bcc: [String], cc: [String], bodyMD5Hash: String? = nil, virtualSend: Bool) { + self._id = _id + self.from = from + self.userId = userId + self.subject = subject + self.attachments = attachments + self.inboxId = inboxId + self.to = to + self.createdAt = createdAt + self.bcc = bcc + self.cc = cc + self.bodyMD5Hash = bodyMD5Hash + self.virtualSend = virtualSend + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case from + case userId + case subject + case attachments + case inboxId + case to + case createdAt + case bcc + case cc + case bodyMD5Hash + case virtualSend + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(from, forKey: .from) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(attachments, forKey: .attachments) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(to, forKey: .to) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(bcc, forKey: .bcc) + try container.encode(cc, forKey: .cc) + try container.encodeIfPresent(bodyMD5Hash, forKey: .bodyMD5Hash) + try container.encode(virtualSend, forKey: .virtualSend) + } + + + +} diff --git a/mailslurp/Models/SetInboxFavouritedOptions.swift b/mailslurp/Models/SetInboxFavouritedOptions.swift new file mode 100644 index 00000000..075df459 --- /dev/null +++ b/mailslurp/Models/SetInboxFavouritedOptions.swift @@ -0,0 +1,33 @@ +// +// SetInboxFavouritedOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for setting inbox favourite state */ +@objc public class SetInboxFavouritedOptions: NSObject, Codable { + + /** Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering */ + public var state: Bool + + public init(state: Bool) { + self.state = state + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case state + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(state, forKey: .state) + } + + + +} diff --git a/mailslurp/Models/SimpleSendEmailOptions.swift b/mailslurp/Models/SimpleSendEmailOptions.swift new file mode 100644 index 00000000..4f2d95a8 --- /dev/null +++ b/mailslurp/Models/SimpleSendEmailOptions.swift @@ -0,0 +1,48 @@ +// +// SimpleSendEmailOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Simplified send email options */ +@objc public class SimpleSendEmailOptions: NSObject, Codable { + + /** ID of inbox to send from. If null an inbox will be created for sending */ + public var senderId: UUID? + /** Email address to send to */ + public var to: String + /** Body of the email message. Supports HTML */ + public var body: String? + /** Subject line of the email */ + public var subject: String? + + public init(senderId: UUID? = nil, to: String, body: String? = nil, subject: String? = nil) { + self.senderId = senderId + self.to = to + self.body = body + self.subject = subject + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case senderId + case to + case body + case subject + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(senderId, forKey: .senderId) + try container.encode(to, forKey: .to) + try container.encodeIfPresent(body, forKey: .body) + try container.encodeIfPresent(subject, forKey: .subject) + } + + + +} diff --git a/mailslurp/Models/SmsDto.swift b/mailslurp/Models/SmsDto.swift new file mode 100644 index 00000000..bab8c76f --- /dev/null +++ b/mailslurp/Models/SmsDto.swift @@ -0,0 +1,59 @@ +// +// SmsDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class SmsDto: NSObject, Codable { + + public var _id: UUID + public var userId: UUID + public var phoneNumber: UUID + public var fromNumber: String + public var body: String + public var read: Bool + public var createdAt: Date + public var updatedAt: Date + + public init(_id: UUID, userId: UUID, phoneNumber: UUID, fromNumber: String, body: String, read: Bool, createdAt: Date, updatedAt: Date) { + self._id = _id + self.userId = userId + self.phoneNumber = phoneNumber + self.fromNumber = fromNumber + self.body = body + self.read = read + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case phoneNumber + case fromNumber + case body + case read + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(phoneNumber, forKey: .phoneNumber) + try container.encode(fromNumber, forKey: .fromNumber) + try container.encode(body, forKey: .body) + try container.encode(read, forKey: .read) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/SmsMatchOption.swift b/mailslurp/Models/SmsMatchOption.swift new file mode 100644 index 00000000..35251897 --- /dev/null +++ b/mailslurp/Models/SmsMatchOption.swift @@ -0,0 +1,51 @@ +// +// SmsMatchOption.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for matching SMS messages in a phone number. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `BODY` should `CONTAIN` value. */ +@objc public class SmsMatchOption: NSObject, Codable { + + public enum Field: String, Codable, CaseIterable { + case body = "BODY" + case from = "FROM" + } + public enum Should: String, Codable, CaseIterable { + case contain = "CONTAIN" + case equal = "EQUAL" + } + /** Fields of an SMS object that can be used to filter results */ + public var field: Field + /** How the value of the email field specified should be compared to the value given in the match options. */ + public var should: Should + /** The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed. */ + public var value: String + + public init(field: Field, should: Should, value: String) { + self.field = field + self.should = should + self.value = value + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case field + case should + case value + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(field, forKey: .field) + try container.encode(should, forKey: .should) + try container.encode(value, forKey: .value) + } + + + +} diff --git a/mailslurp/Models/SmsPreview.swift b/mailslurp/Models/SmsPreview.swift new file mode 100644 index 00000000..53110422 --- /dev/null +++ b/mailslurp/Models/SmsPreview.swift @@ -0,0 +1,51 @@ +// +// SmsPreview.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class SmsPreview: NSObject, Codable { + + public var _id: UUID + public var userId: UUID + public var body: String + public var phoneNumber: UUID + public var fromNumber: String + public var createdAt: Date + + public init(_id: UUID, userId: UUID, body: String, phoneNumber: UUID, fromNumber: String, createdAt: Date) { + self._id = _id + self.userId = userId + self.body = body + self.phoneNumber = phoneNumber + self.fromNumber = fromNumber + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case body + case phoneNumber + case fromNumber + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(body, forKey: .body) + try container.encode(phoneNumber, forKey: .phoneNumber) + try container.encode(fromNumber, forKey: .fromNumber) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/SmsProjection.swift b/mailslurp/Models/SmsProjection.swift new file mode 100644 index 00000000..d74bfcce --- /dev/null +++ b/mailslurp/Models/SmsProjection.swift @@ -0,0 +1,56 @@ +// +// SmsProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** SMS projection */ +@objc public class SmsProjection: NSObject, Codable { + + public var _id: UUID + public var body: String + public var userId: UUID + public var phoneNumber: UUID + public var createdAt: Date + public var fromNumber: String + public var read: Bool + + public init(_id: UUID, body: String, userId: UUID, phoneNumber: UUID, createdAt: Date, fromNumber: String, read: Bool) { + self._id = _id + self.body = body + self.userId = userId + self.phoneNumber = phoneNumber + self.createdAt = createdAt + self.fromNumber = fromNumber + self.read = read + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case body + case userId + case phoneNumber + case createdAt + case fromNumber + case read + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(body, forKey: .body) + try container.encode(userId, forKey: .userId) + try container.encode(phoneNumber, forKey: .phoneNumber) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(fromNumber, forKey: .fromNumber) + try container.encode(read, forKey: .read) + } + + + +} diff --git a/mailslurp/Models/Sort.swift b/mailslurp/Models/Sort.swift new file mode 100644 index 00000000..9c8a5a60 --- /dev/null +++ b/mailslurp/Models/Sort.swift @@ -0,0 +1,54 @@ +// +// Sort.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class Sort: NSObject, Codable { + + public var empty: Bool? + public var emptyNum: NSNumber? { + get { + return empty as NSNumber? + } + } + public var sorted: Bool? + public var sortedNum: NSNumber? { + get { + return sorted as NSNumber? + } + } + public var unsorted: Bool? + public var unsortedNum: NSNumber? { + get { + return unsorted as NSNumber? + } + } + + public init(empty: Bool? = nil, sorted: Bool? = nil, unsorted: Bool? = nil) { + self.empty = empty + self.sorted = sorted + self.unsorted = unsorted + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case empty + case sorted + case unsorted + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(empty, forKey: .empty) + try container.encodeIfPresent(sorted, forKey: .sorted) + try container.encodeIfPresent(unsorted, forKey: .unsorted) + } + + + +} diff --git a/mailslurp/Models/TemplateDto.swift b/mailslurp/Models/TemplateDto.swift new file mode 100644 index 00000000..c7f625b3 --- /dev/null +++ b/mailslurp/Models/TemplateDto.swift @@ -0,0 +1,53 @@ +// +// TemplateDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email template */ +@objc public class TemplateDto: NSObject, Codable { + + /** ID of template */ + public var _id: UUID + /** Template name */ + public var name: String + /** Variables available in template that can be replaced with values */ + public var variables: [TemplateVariable] + /** Content of the template */ + public var content: String + /** Created at time */ + public var createdAt: Date + + public init(_id: UUID, name: String, variables: [TemplateVariable], content: String, createdAt: Date) { + self._id = _id + self.name = name + self.variables = variables + self.content = content + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case name + case variables + case content + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(name, forKey: .name) + try container.encode(variables, forKey: .variables) + try container.encode(content, forKey: .content) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/TemplatePreview.swift b/mailslurp/Models/TemplatePreview.swift new file mode 100644 index 00000000..94778f57 --- /dev/null +++ b/mailslurp/Models/TemplatePreview.swift @@ -0,0 +1,31 @@ +// +// TemplatePreview.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class TemplatePreview: NSObject, Codable { + + public var preview: String + + public init(preview: String) { + self.preview = preview + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case preview + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(preview, forKey: .preview) + } + + + +} diff --git a/mailslurp/Models/TemplateProjection.swift b/mailslurp/Models/TemplateProjection.swift new file mode 100644 index 00000000..0a92ec0d --- /dev/null +++ b/mailslurp/Models/TemplateProjection.swift @@ -0,0 +1,48 @@ +// +// TemplateProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Email template data */ +@objc public class TemplateProjection: NSObject, Codable { + + public var name: String + public var _id: UUID + public var createdAt: Date + public var updatedAt: Date + public var variables: [String] + + public init(name: String, _id: UUID, createdAt: Date, updatedAt: Date, variables: [String]) { + self.name = name + self._id = _id + self.createdAt = createdAt + self.updatedAt = updatedAt + self.variables = variables + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _id = "id" + case createdAt + case updatedAt + case variables + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(_id, forKey: ._id) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(variables, forKey: .variables) + } + + + +} diff --git a/mailslurp/Models/TemplateVariable.swift b/mailslurp/Models/TemplateVariable.swift new file mode 100644 index 00000000..f775ff6a --- /dev/null +++ b/mailslurp/Models/TemplateVariable.swift @@ -0,0 +1,41 @@ +// +// TemplateVariable.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Variable for use with email template */ +@objc public class TemplateVariable: NSObject, Codable { + + public enum VariableType: String, Codable, CaseIterable { + case string = "STRING" + } + /** Name of variable. This can be used in a template as {{name}} */ + public var name: String + /** The type of variable */ + public var variableType: VariableType + + public init(name: String, variableType: VariableType) { + self.name = name + self.variableType = variableType + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case variableType + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(variableType, forKey: .variableType) + } + + + +} diff --git a/mailslurp/Models/TestNewInboxForwarderOptions.swift b/mailslurp/Models/TestNewInboxForwarderOptions.swift new file mode 100644 index 00000000..89d23aa0 --- /dev/null +++ b/mailslurp/Models/TestNewInboxForwarderOptions.swift @@ -0,0 +1,36 @@ +// +// TestNewInboxForwarderOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for testing new inbox forwarder rules */ +@objc public class TestNewInboxForwarderOptions: NSObject, Codable { + + public var inboxForwarderTestOptions: InboxForwarderTestOptions + public var createInboxForwarderOptions: CreateInboxForwarderOptions + + public init(inboxForwarderTestOptions: InboxForwarderTestOptions, createInboxForwarderOptions: CreateInboxForwarderOptions) { + self.inboxForwarderTestOptions = inboxForwarderTestOptions + self.createInboxForwarderOptions = createInboxForwarderOptions + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxForwarderTestOptions + case createInboxForwarderOptions + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(inboxForwarderTestOptions, forKey: .inboxForwarderTestOptions) + try container.encode(createInboxForwarderOptions, forKey: .createInboxForwarderOptions) + } + + + +} diff --git a/mailslurp/Models/TestNewInboxRulesetOptions.swift b/mailslurp/Models/TestNewInboxRulesetOptions.swift new file mode 100644 index 00000000..e0c30b50 --- /dev/null +++ b/mailslurp/Models/TestNewInboxRulesetOptions.swift @@ -0,0 +1,36 @@ +// +// TestNewInboxRulesetOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Test inbox ruleset options */ +@objc public class TestNewInboxRulesetOptions: NSObject, Codable { + + public var inboxRulesetTestOptions: InboxRulesetTestOptions + public var createInboxRulesetOptions: CreateInboxRulesetOptions + + public init(inboxRulesetTestOptions: InboxRulesetTestOptions, createInboxRulesetOptions: CreateInboxRulesetOptions) { + self.inboxRulesetTestOptions = inboxRulesetTestOptions + self.createInboxRulesetOptions = createInboxRulesetOptions + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxRulesetTestOptions + case createInboxRulesetOptions + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(inboxRulesetTestOptions, forKey: .inboxRulesetTestOptions) + try container.encode(createInboxRulesetOptions, forKey: .createInboxRulesetOptions) + } + + + +} diff --git a/mailslurp/Models/TestPhoneNumberOptions.swift b/mailslurp/Models/TestPhoneNumberOptions.swift new file mode 100644 index 00000000..d3fe3f64 --- /dev/null +++ b/mailslurp/Models/TestPhoneNumberOptions.swift @@ -0,0 +1,31 @@ +// +// TestPhoneNumberOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class TestPhoneNumberOptions: NSObject, Codable { + + public var message: String + + public init(message: String) { + self.message = message + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(message, forKey: .message) + } + + + +} diff --git a/mailslurp/Models/ThreadProjection.swift b/mailslurp/Models/ThreadProjection.swift new file mode 100644 index 00000000..893f9cb9 --- /dev/null +++ b/mailslurp/Models/ThreadProjection.swift @@ -0,0 +1,83 @@ +// +// ThreadProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** A thread is a message thread created for a message received by an alias */ +@objc public class ThreadProjection: NSObject, Codable { + + /** Name of thread */ + public var name: String? + /** ID of email thread */ + public var _id: UUID + /** Thread subject */ + public var subject: String? + /** Inbox ID */ + public var inboxId: UUID + /** User ID */ + public var userId: UUID + /** To recipients */ + public var to: [String] + /** Created at DateTime */ + public var createdAt: Date + /** Updated at DateTime */ + public var updatedAt: Date + /** BCC recipients */ + public var bcc: [String]? + /** CC recipients */ + public var cc: [String]? + /** Alias ID */ + public var aliasId: UUID + + public init(name: String? = nil, _id: UUID, subject: String? = nil, inboxId: UUID, userId: UUID, to: [String], createdAt: Date, updatedAt: Date, bcc: [String]? = nil, cc: [String]? = nil, aliasId: UUID) { + self.name = name + self._id = _id + self.subject = subject + self.inboxId = inboxId + self.userId = userId + self.to = to + self.createdAt = createdAt + self.updatedAt = updatedAt + self.bcc = bcc + self.cc = cc + self.aliasId = aliasId + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _id = "id" + case subject + case inboxId + case userId + case to + case createdAt + case updatedAt + case bcc + case cc + case aliasId + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(userId, forKey: .userId) + try container.encode(to, forKey: .to) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encodeIfPresent(bcc, forKey: .bcc) + try container.encodeIfPresent(cc, forKey: .cc) + try container.encode(aliasId, forKey: .aliasId) + } + + + +} diff --git a/mailslurp/Models/TrackingPixelDto.swift b/mailslurp/Models/TrackingPixelDto.swift new file mode 100644 index 00000000..d73003af --- /dev/null +++ b/mailslurp/Models/TrackingPixelDto.swift @@ -0,0 +1,64 @@ +// +// TrackingPixelDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Tracking pixel */ +@objc public class TrackingPixelDto: NSObject, Codable { + + public var _id: UUID + public var seen: Bool + public var recipient: String? + public var html: String + public var url: String + public var inboxId: UUID? + public var sentEmailId: UUID? + public var seenAt: Date? + public var createdAt: Date + + public init(_id: UUID, seen: Bool, recipient: String? = nil, html: String, url: String, inboxId: UUID? = nil, sentEmailId: UUID? = nil, seenAt: Date? = nil, createdAt: Date) { + self._id = _id + self.seen = seen + self.recipient = recipient + self.html = html + self.url = url + self.inboxId = inboxId + self.sentEmailId = sentEmailId + self.seenAt = seenAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case seen + case recipient + case html + case url + case inboxId + case sentEmailId + case seenAt + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(seen, forKey: .seen) + try container.encodeIfPresent(recipient, forKey: .recipient) + try container.encode(html, forKey: .html) + try container.encode(url, forKey: .url) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encodeIfPresent(sentEmailId, forKey: .sentEmailId) + try container.encodeIfPresent(seenAt, forKey: .seenAt) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/TrackingPixelProjection.swift b/mailslurp/Models/TrackingPixelProjection.swift new file mode 100644 index 00000000..c534c41d --- /dev/null +++ b/mailslurp/Models/TrackingPixelProjection.swift @@ -0,0 +1,64 @@ +// +// TrackingPixelProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Tracking pixel data */ +@objc public class TrackingPixelProjection: NSObject, Codable { + + public var name: String? + public var _id: UUID + public var inboxId: UUID? + public var userId: UUID + public var sentEmailId: UUID? + public var createdAt: Date + public var recipient: String? + public var seen: Bool + public var seenAt: Date? + + public init(name: String? = nil, _id: UUID, inboxId: UUID? = nil, userId: UUID, sentEmailId: UUID? = nil, createdAt: Date, recipient: String? = nil, seen: Bool, seenAt: Date? = nil) { + self.name = name + self._id = _id + self.inboxId = inboxId + self.userId = userId + self.sentEmailId = sentEmailId + self.createdAt = createdAt + self.recipient = recipient + self.seen = seen + self.seenAt = seenAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _id = "id" + case inboxId + case userId + case sentEmailId + case createdAt + case recipient + case seen + case seenAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(sentEmailId, forKey: .sentEmailId) + try container.encode(createdAt, forKey: .createdAt) + try container.encodeIfPresent(recipient, forKey: .recipient) + try container.encode(seen, forKey: .seen) + try container.encodeIfPresent(seenAt, forKey: .seenAt) + } + + + +} diff --git a/mailslurp/Models/UnknownMissedEmailProjection.swift b/mailslurp/Models/UnknownMissedEmailProjection.swift new file mode 100644 index 00000000..2c383daf --- /dev/null +++ b/mailslurp/Models/UnknownMissedEmailProjection.swift @@ -0,0 +1,48 @@ +// +// UnknownMissedEmailProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Unknown missed email projection */ +@objc public class UnknownMissedEmailProjection: NSObject, Codable { + + public var _id: UUID + public var from: String? + public var subject: String? + public var to: [String]? + public var createdAt: Date + + public init(_id: UUID, from: String? = nil, subject: String? = nil, to: [String]? = nil, createdAt: Date) { + self._id = _id + self.from = from + self.subject = subject + self.to = to + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case from + case subject + case to + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encodeIfPresent(to, forKey: .to) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/UnreadCount.swift b/mailslurp/Models/UnreadCount.swift new file mode 100644 index 00000000..404e8f60 --- /dev/null +++ b/mailslurp/Models/UnreadCount.swift @@ -0,0 +1,32 @@ +// +// UnreadCount.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Number of unread emails */ +@objc public class UnreadCount: NSObject, Codable { + + public var count: Int64 + + public init(count: Int64) { + self.count = count + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case count + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(count, forKey: .count) + } + + + +} diff --git a/mailslurp/Models/UnseenErrorCountDto.swift b/mailslurp/Models/UnseenErrorCountDto.swift new file mode 100644 index 00000000..281c9f9e --- /dev/null +++ b/mailslurp/Models/UnseenErrorCountDto.swift @@ -0,0 +1,32 @@ +// +// UnseenErrorCountDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Number of unseen errors */ +@objc public class UnseenErrorCountDto: NSObject, Codable { + + public var count: Int64 + + public init(count: Int64) { + self.count = count + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case count + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(count, forKey: .count) + } + + + +} diff --git a/mailslurp/Models/UpdateAliasOptions.swift b/mailslurp/Models/UpdateAliasOptions.swift new file mode 100644 index 00000000..57ed0654 --- /dev/null +++ b/mailslurp/Models/UpdateAliasOptions.swift @@ -0,0 +1,33 @@ +// +// UpdateAliasOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Update an email alias */ +@objc public class UpdateAliasOptions: NSObject, Codable { + + /** Optional name for alias */ + public var name: String? + + public init(name: String? = nil) { + self.name = name + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + } + + + +} diff --git a/mailslurp/Models/UpdateDomainOptions.swift b/mailslurp/Models/UpdateDomainOptions.swift new file mode 100644 index 00000000..07af5518 --- /dev/null +++ b/mailslurp/Models/UpdateDomainOptions.swift @@ -0,0 +1,32 @@ +// +// UpdateDomainOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not functionally currently until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help. */ +@objc public class UpdateDomainOptions: NSObject, Codable { + + public var catchAllInboxId: UUID? + + public init(catchAllInboxId: UUID? = nil) { + self.catchAllInboxId = catchAllInboxId + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case catchAllInboxId + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(catchAllInboxId, forKey: .catchAllInboxId) + } + + + +} diff --git a/mailslurp/Models/UpdateGroupContacts.swift b/mailslurp/Models/UpdateGroupContacts.swift new file mode 100644 index 00000000..cd89c90b --- /dev/null +++ b/mailslurp/Models/UpdateGroupContacts.swift @@ -0,0 +1,32 @@ +// +// UpdateGroupContacts.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Update group contacts options. Pass a list of contact ids to replace existing group contacts. */ +@objc public class UpdateGroupContacts: NSObject, Codable { + + public var contactIds: [UUID] + + public init(contactIds: [UUID]) { + self.contactIds = contactIds + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case contactIds + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(contactIds, forKey: .contactIds) + } + + + +} diff --git a/mailslurp/Models/UpdateInboxOptions.swift b/mailslurp/Models/UpdateInboxOptions.swift new file mode 100644 index 00000000..3f6cbe07 --- /dev/null +++ b/mailslurp/Models/UpdateInboxOptions.swift @@ -0,0 +1,58 @@ +// +// UpdateInboxOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for updating inbox properties */ +@objc public class UpdateInboxOptions: NSObject, Codable { + + /** Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search */ + public var name: String? + /** Description of an inbox for labelling and searching purposes */ + public var _description: String? + /** Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. */ + public var tags: [String]? + /** Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email. */ + public var expiresAt: Date? + /** Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering */ + public var favourite: Bool? + public var favouriteNum: NSNumber? { + get { + return favourite as NSNumber? + } + } + + public init(name: String? = nil, _description: String? = nil, tags: [String]? = nil, expiresAt: Date? = nil, favourite: Bool? = nil) { + self.name = name + self._description = _description + self.tags = tags + self.expiresAt = expiresAt + self.favourite = favourite + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _description = "description" + case tags + case expiresAt + case favourite + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(_description, forKey: ._description) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encodeIfPresent(expiresAt, forKey: .expiresAt) + try container.encodeIfPresent(favourite, forKey: .favourite) + } + + + +} diff --git a/mailslurp/Models/UploadAttachmentOptions.swift b/mailslurp/Models/UploadAttachmentOptions.swift new file mode 100644 index 00000000..790b0845 --- /dev/null +++ b/mailslurp/Models/UploadAttachmentOptions.swift @@ -0,0 +1,43 @@ +// +// UploadAttachmentOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for uploading files for attachments. When sending emails with the API that require attachments first upload each attachment. Then use the returned attachment ID in your `SendEmailOptions` when sending an email. This way you can use attachments multiple times once they have been uploaded. */ +@objc public class UploadAttachmentOptions: NSObject, Codable { + + /** Optional contentType for file. For instance `application/pdf` */ + public var contentType: String? + /** Optional filename to save upload with. Will be the name that is shown in email clients */ + public var filename: String? + /** Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/ */ + public var base64Contents: String + + public init(contentType: String? = nil, filename: String? = nil, base64Contents: String) { + self.contentType = contentType + self.filename = filename + self.base64Contents = base64Contents + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case contentType + case filename + case base64Contents + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(contentType, forKey: .contentType) + try container.encodeIfPresent(filename, forKey: .filename) + try container.encode(base64Contents, forKey: .base64Contents) + } + + + +} diff --git a/mailslurp/Models/UserInfoDto.swift b/mailslurp/Models/UserInfoDto.swift new file mode 100644 index 00000000..110b0420 --- /dev/null +++ b/mailslurp/Models/UserInfoDto.swift @@ -0,0 +1,66 @@ +// +// UserInfoDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class UserInfoDto: NSObject, Codable { + + public enum AccountState: String, Codable, CaseIterable { + case frozen = "FROZEN" + case active = "ACTIVE" + } + public enum SubscriptionType: String, Codable, CaseIterable { + case proMonthly = "PRO_MONTHLY" + case starter = "STARTER" + case team = "TEAM" + case enterprise = "ENTERPRISE" + } + public enum AccountType: String, Codable, CaseIterable { + case solo = "SOLO" + case childSolo = "CHILD_SOLO" + case childTeam = "CHILD_TEAM" + } + public var _id: UUID + public var emailAddress: String + public var accountState: AccountState + public var subscriptionType: SubscriptionType? + public var accountType: AccountType + public var createdAt: Date + + public init(_id: UUID, emailAddress: String, accountState: AccountState, subscriptionType: SubscriptionType? = nil, accountType: AccountType, createdAt: Date) { + self._id = _id + self.emailAddress = emailAddress + self.accountState = accountState + self.subscriptionType = subscriptionType + self.accountType = accountType + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case emailAddress + case accountState + case subscriptionType + case accountType + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encode(accountState, forKey: .accountState) + try container.encodeIfPresent(subscriptionType, forKey: .subscriptionType) + try container.encode(accountType, forKey: .accountType) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/ValidateEmailAddressListOptions.swift b/mailslurp/Models/ValidateEmailAddressListOptions.swift new file mode 100644 index 00000000..0bfb53ed --- /dev/null +++ b/mailslurp/Models/ValidateEmailAddressListOptions.swift @@ -0,0 +1,32 @@ +// +// ValidateEmailAddressListOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for validating a list of email addresses */ +@objc public class ValidateEmailAddressListOptions: NSObject, Codable { + + public var emailAddressList: [String] + + public init(emailAddressList: [String]) { + self.emailAddressList = emailAddressList + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case emailAddressList + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(emailAddressList, forKey: .emailAddressList) + } + + + +} diff --git a/mailslurp/Models/ValidateEmailAddressListResult.swift b/mailslurp/Models/ValidateEmailAddressListResult.swift new file mode 100644 index 00000000..af8caaee --- /dev/null +++ b/mailslurp/Models/ValidateEmailAddressListResult.swift @@ -0,0 +1,40 @@ +// +// ValidateEmailAddressListResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of validating a list of email addresses */ +@objc public class ValidateEmailAddressListResult: NSObject, Codable { + + public var validEmailAddresses: [String] + public var invalidEmailAddresses: [String] + public var resultMapEmailAddressIsValid: [String: Bool] + + public init(validEmailAddresses: [String], invalidEmailAddresses: [String], resultMapEmailAddressIsValid: [String: Bool]) { + self.validEmailAddresses = validEmailAddresses + self.invalidEmailAddresses = invalidEmailAddresses + self.resultMapEmailAddressIsValid = resultMapEmailAddressIsValid + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case validEmailAddresses + case invalidEmailAddresses + case resultMapEmailAddressIsValid + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(validEmailAddresses, forKey: .validEmailAddresses) + try container.encode(invalidEmailAddresses, forKey: .invalidEmailAddresses) + try container.encode(resultMapEmailAddressIsValid, forKey: .resultMapEmailAddressIsValid) + } + + + +} diff --git a/mailslurp/Models/ValidationDto.swift b/mailslurp/Models/ValidationDto.swift new file mode 100644 index 00000000..8084c6b7 --- /dev/null +++ b/mailslurp/Models/ValidationDto.swift @@ -0,0 +1,37 @@ +// +// ValidationDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Response object for email validation operation */ +@objc public class ValidationDto: NSObject, Codable { + + /** ID of the email validated */ + public var emailId: UUID + public var html: HTMLValidationResult + + public init(emailId: UUID, html: HTMLValidationResult) { + self.emailId = emailId + self.html = html + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case emailId + case html + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(emailId, forKey: .emailId) + try container.encode(html, forKey: .html) + } + + + +} diff --git a/mailslurp/Models/ValidationMessage.swift b/mailslurp/Models/ValidationMessage.swift new file mode 100644 index 00000000..3778df6a --- /dev/null +++ b/mailslurp/Models/ValidationMessage.swift @@ -0,0 +1,36 @@ +// +// ValidationMessage.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Optional warnings resulting from HTML validation */ +@objc public class ValidationMessage: NSObject, Codable { + + public var lineNumber: Int + public var message: String? + + public init(lineNumber: Int, message: String? = nil) { + self.lineNumber = lineNumber + self.message = message + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case lineNumber + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(lineNumber, forKey: .lineNumber) + try container.encodeIfPresent(message, forKey: .message) + } + + + +} diff --git a/mailslurp/Models/VerifyEmailAddressOptions.swift b/mailslurp/Models/VerifyEmailAddressOptions.swift new file mode 100644 index 00000000..587f1955 --- /dev/null +++ b/mailslurp/Models/VerifyEmailAddressOptions.swift @@ -0,0 +1,49 @@ +// +// VerifyEmailAddressOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Options for verifying that an email address exists at a remote mail server. */ +@objc public class VerifyEmailAddressOptions: NSObject, Codable { + + public var mailServerDomain: String? + public var emailAddress: String + public var senderEmailAddress: String? + public var port: Int? + public var portNum: NSNumber? { + get { + return port as NSNumber? + } + } + + public init(mailServerDomain: String? = nil, emailAddress: String, senderEmailAddress: String? = nil, port: Int? = nil) { + self.mailServerDomain = mailServerDomain + self.emailAddress = emailAddress + self.senderEmailAddress = senderEmailAddress + self.port = port + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case mailServerDomain + case emailAddress + case senderEmailAddress + case port + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(mailServerDomain, forKey: .mailServerDomain) + try container.encode(emailAddress, forKey: .emailAddress) + try container.encodeIfPresent(senderEmailAddress, forKey: .senderEmailAddress) + try container.encodeIfPresent(port, forKey: .port) + } + + + +} diff --git a/mailslurp/Models/VerifyWebhookSignatureOptions.swift b/mailslurp/Models/VerifyWebhookSignatureOptions.swift new file mode 100644 index 00000000..464512a7 --- /dev/null +++ b/mailslurp/Models/VerifyWebhookSignatureOptions.swift @@ -0,0 +1,35 @@ +// +// VerifyWebhookSignatureOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class VerifyWebhookSignatureOptions: NSObject, Codable { + + public var messageId: String + public var signature: String + + public init(messageId: String, signature: String) { + self.messageId = messageId + self.signature = signature + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case signature + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(signature, forKey: .signature) + } + + + +} diff --git a/mailslurp/Models/VerifyWebhookSignatureResults.swift b/mailslurp/Models/VerifyWebhookSignatureResults.swift new file mode 100644 index 00000000..bf6f392c --- /dev/null +++ b/mailslurp/Models/VerifyWebhookSignatureResults.swift @@ -0,0 +1,31 @@ +// +// VerifyWebhookSignatureResults.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class VerifyWebhookSignatureResults: NSObject, Codable { + + public var isValid: Bool + + public init(isValid: Bool) { + self.isValid = isValid + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case isValid + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(isValid, forKey: .isValid) + } + + + +} diff --git a/mailslurp/Models/WaitForConditions.swift b/mailslurp/Models/WaitForConditions.swift new file mode 100644 index 00000000..72884ddb --- /dev/null +++ b/mailslurp/Models/WaitForConditions.swift @@ -0,0 +1,101 @@ +// +// WaitForConditions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Conditions to apply to emails that you are waiting for */ +@objc public class WaitForConditions: NSObject, Codable { + + public enum CountType: String, Codable, CaseIterable { + case exactly = "EXACTLY" + case atleast = "ATLEAST" + } + public enum SortDirection: String, Codable, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + /** ID of inbox to search within and apply conditions to. Essentially filtering the emails found to give a count. */ + public var inboxId: UUID + /** Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation. */ + public var count: Int? + public var countNum: NSNumber? { + get { + return count as NSNumber? + } + } + /** Max time in milliseconds to wait between retries if a `timeout` is specified. */ + public var delayTimeout: Int64? + public var delayTimeoutNum: NSNumber? { + get { + return delayTimeout as NSNumber? + } + } + /** Max time in milliseconds to retry the `waitFor` operation until conditions are met. */ + public var timeout: Int64 + /** Apply conditions only to **unread** emails. All emails begin with `read=false`. An email is marked `read=true` when an `EmailDto` representation of it has been returned to the user at least once. For example you have called `getEmail` or `waitForLatestEmail` etc., or you have viewed the email in the dashboard. */ + public var unreadOnly: Bool? + public var unreadOnlyNum: NSNumber? { + get { + return unreadOnly as NSNumber? + } + } + /** How result size should be compared with the expected size. Exactly or at-least matching result? */ + public var countType: CountType? + /** Conditions that should be matched for an email to qualify for results. Each condition will be applied in order to each email within an inbox to filter a result list of matching emails you are waiting for. */ + public var matches: [MatchOption]? + /** Direction to sort matching emails by created time */ + public var sortDirection: SortDirection? + /** ISO Date Time earliest time of email to consider. Filter for matching emails that were received after this date */ + public var since: Date? + /** ISO Date Time latest time of email to consider. Filter for matching emails that were received before this date */ + public var before: Date? + + public init(inboxId: UUID, count: Int? = nil, delayTimeout: Int64? = nil, timeout: Int64, unreadOnly: Bool? = nil, countType: CountType? = nil, matches: [MatchOption]? = nil, sortDirection: SortDirection? = nil, since: Date? = nil, before: Date? = nil) { + self.inboxId = inboxId + self.count = count + self.delayTimeout = delayTimeout + self.timeout = timeout + self.unreadOnly = unreadOnly + self.countType = countType + self.matches = matches + self.sortDirection = sortDirection + self.since = since + self.before = before + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case inboxId + case count + case delayTimeout + case timeout + case unreadOnly + case countType + case matches + case sortDirection + case since + case before + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(inboxId, forKey: .inboxId) + try container.encodeIfPresent(count, forKey: .count) + try container.encodeIfPresent(delayTimeout, forKey: .delayTimeout) + try container.encode(timeout, forKey: .timeout) + try container.encodeIfPresent(unreadOnly, forKey: .unreadOnly) + try container.encodeIfPresent(countType, forKey: .countType) + try container.encodeIfPresent(matches, forKey: .matches) + try container.encodeIfPresent(sortDirection, forKey: .sortDirection) + try container.encodeIfPresent(since, forKey: .since) + try container.encodeIfPresent(before, forKey: .before) + } + + + +} diff --git a/mailslurp/Models/WaitForSingleSmsOptions.swift b/mailslurp/Models/WaitForSingleSmsOptions.swift new file mode 100644 index 00000000..6b7841f9 --- /dev/null +++ b/mailslurp/Models/WaitForSingleSmsOptions.swift @@ -0,0 +1,69 @@ +// +// WaitForSingleSmsOptions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +@objc public class WaitForSingleSmsOptions: NSObject, Codable { + + public enum SortDirection: String, Codable, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + public var phoneNumberId: UUID + public var timeout: Int64 + public var unreadOnly: Bool? + public var unreadOnlyNum: NSNumber? { + get { + return unreadOnly as NSNumber? + } + } + public var before: Date? + public var since: Date? + public var sortDirection: SortDirection? + public var delay: Int64? + public var delayNum: NSNumber? { + get { + return delay as NSNumber? + } + } + + public init(phoneNumberId: UUID, timeout: Int64, unreadOnly: Bool? = nil, before: Date? = nil, since: Date? = nil, sortDirection: SortDirection? = nil, delay: Int64? = nil) { + self.phoneNumberId = phoneNumberId + self.timeout = timeout + self.unreadOnly = unreadOnly + self.before = before + self.since = since + self.sortDirection = sortDirection + self.delay = delay + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case phoneNumberId + case timeout + case unreadOnly + case before + case since + case sortDirection + case delay + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(phoneNumberId, forKey: .phoneNumberId) + try container.encode(timeout, forKey: .timeout) + try container.encodeIfPresent(unreadOnly, forKey: .unreadOnly) + try container.encodeIfPresent(before, forKey: .before) + try container.encodeIfPresent(since, forKey: .since) + try container.encodeIfPresent(sortDirection, forKey: .sortDirection) + try container.encodeIfPresent(delay, forKey: .delay) + } + + + +} diff --git a/mailslurp/Models/WaitForSmsConditions.swift b/mailslurp/Models/WaitForSmsConditions.swift new file mode 100644 index 00000000..70f4f518 --- /dev/null +++ b/mailslurp/Models/WaitForSmsConditions.swift @@ -0,0 +1,106 @@ +// +// WaitForSmsConditions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Conditions to apply to emails that you are waiting for */ +@objc public class WaitForSmsConditions: NSObject, Codable { + + public enum CountType: String, Codable, CaseIterable { + case exactly = "EXACTLY" + case atleast = "ATLEAST" + } + public enum SortDirection: String, Codable, CaseIterable { + case asc = "ASC" + case desc = "DESC" + } + /** ID of phone number to search within and apply conditions to. Essentially filtering the SMS found to give a count. */ + public var phoneNumberId: UUID + /** Limit results */ + public var limit: Int? + public var limitNum: NSNumber? { + get { + return limit as NSNumber? + } + } + /** Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation. */ + public var count: Int64 + /** Max time in milliseconds to wait between retries if a `timeout` is specified. */ + public var delayTimeout: Int64? + public var delayTimeoutNum: NSNumber? { + get { + return delayTimeout as NSNumber? + } + } + /** Max time in milliseconds to retry the `waitFor` operation until conditions are met. */ + public var timeout: Int64 + /** Apply conditions only to **unread** SMS. All SMS messages begin with `read=false`. An SMS is marked `read=true` when an `SMS` has been returned to the user at least once. For example you have called `getSms` or `waitForSms` etc., or you have viewed the SMS in the dashboard. */ + public var unreadOnly: Bool? + public var unreadOnlyNum: NSNumber? { + get { + return unreadOnly as NSNumber? + } + } + /** How result size should be compared with the expected size. Exactly or at-least matching result? */ + public var countType: CountType? + /** Conditions that should be matched for an SMS to qualify for results. Each condition will be applied in order to each SMS within a phone number to filter a result list of matching SMSs you are waiting for. */ + public var matches: [SmsMatchOption]? + /** Direction to sort matching SMSs by created time */ + public var sortDirection: SortDirection? + /** ISO Date Time earliest time of SMS to consider. Filter for matching SMSs that were received after this date */ + public var since: Date? + /** ISO Date Time latest time of SMS to consider. Filter for matching SMSs that were received before this date */ + public var before: Date? + + public init(phoneNumberId: UUID, limit: Int? = nil, count: Int64, delayTimeout: Int64? = nil, timeout: Int64, unreadOnly: Bool? = nil, countType: CountType? = nil, matches: [SmsMatchOption]? = nil, sortDirection: SortDirection? = nil, since: Date? = nil, before: Date? = nil) { + self.phoneNumberId = phoneNumberId + self.limit = limit + self.count = count + self.delayTimeout = delayTimeout + self.timeout = timeout + self.unreadOnly = unreadOnly + self.countType = countType + self.matches = matches + self.sortDirection = sortDirection + self.since = since + self.before = before + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case phoneNumberId + case limit + case count + case delayTimeout + case timeout + case unreadOnly + case countType + case matches + case sortDirection + case since + case before + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(phoneNumberId, forKey: .phoneNumberId) + try container.encodeIfPresent(limit, forKey: .limit) + try container.encode(count, forKey: .count) + try container.encodeIfPresent(delayTimeout, forKey: .delayTimeout) + try container.encode(timeout, forKey: .timeout) + try container.encodeIfPresent(unreadOnly, forKey: .unreadOnly) + try container.encodeIfPresent(countType, forKey: .countType) + try container.encodeIfPresent(matches, forKey: .matches) + try container.encodeIfPresent(sortDirection, forKey: .sortDirection) + try container.encodeIfPresent(since, forKey: .since) + try container.encodeIfPresent(before, forKey: .before) + } + + + +} diff --git a/mailslurp/Models/WebhookBouncePayload.swift b/mailslurp/Models/WebhookBouncePayload.swift new file mode 100644 index 00000000..766eb4cc --- /dev/null +++ b/mailslurp/Models/WebhookBouncePayload.swift @@ -0,0 +1,77 @@ +// +// WebhookBouncePayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** BOUNCE webhook payload. Sent to your webhook url endpoint via HTTP POST when an email bounced or was rejected by a recipient. Save the recipients to a ban list on your server and avoid emailing them again. It is recommended you also listen to the BOUNCE_RECIPIENT payload. */ +@objc public class WebhookBouncePayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + /** Name of the webhook being triggered */ + public var webhookName: String? + /** ID of the bounce email record. Use the ID with the bounce controller to view more information */ + public var bounceId: UUID + public var sentToRecipients: [String]? + public var sender: String + /** Email addresses that resulted in a bounce or email being rejected. Please save these recipients and avoid emailing them in the future to maintain your reputation. */ + public var bounceRecipients: [String]? + + public init(messageId: String, webhookId: UUID, eventName: EventName, webhookName: String? = nil, bounceId: UUID, sentToRecipients: [String]? = nil, sender: String, bounceRecipients: [String]? = nil) { + self.messageId = messageId + self.webhookId = webhookId + self.eventName = eventName + self.webhookName = webhookName + self.bounceId = bounceId + self.sentToRecipients = sentToRecipients + self.sender = sender + self.bounceRecipients = bounceRecipients + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case eventName + case webhookName + case bounceId + case sentToRecipients + case sender + case bounceRecipients + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encode(eventName, forKey: .eventName) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(bounceId, forKey: .bounceId) + try container.encodeIfPresent(sentToRecipients, forKey: .sentToRecipients) + try container.encode(sender, forKey: .sender) + try container.encodeIfPresent(bounceRecipients, forKey: .bounceRecipients) + } + + + +} diff --git a/mailslurp/Models/WebhookBounceRecipientPayload.swift b/mailslurp/Models/WebhookBounceRecipientPayload.swift new file mode 100644 index 00000000..4a3cce04 --- /dev/null +++ b/mailslurp/Models/WebhookBounceRecipientPayload.swift @@ -0,0 +1,64 @@ +// +// WebhookBounceRecipientPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** BOUNCE_RECIPIENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email caused a bounce to occur for a recipient. Save the recipient to a ban list of your server and avoid email them again. */ +@objc public class WebhookBounceRecipientPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + /** Name of the webhook being triggered */ + public var webhookName: String? + /** Email address that caused a bounce. Make note of the address and try not to message it again to preserve your reputation. */ + public var recipient: String + + public init(messageId: String, webhookId: UUID, eventName: EventName, webhookName: String? = nil, recipient: String) { + self.messageId = messageId + self.webhookId = webhookId + self.eventName = eventName + self.webhookName = webhookName + self.recipient = recipient + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case eventName + case webhookName + case recipient + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encode(eventName, forKey: .eventName) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(recipient, forKey: .recipient) + } + + + +} diff --git a/mailslurp/Models/WebhookDto.swift b/mailslurp/Models/WebhookDto.swift new file mode 100644 index 00000000..8e6669c8 --- /dev/null +++ b/mailslurp/Models/WebhookDto.swift @@ -0,0 +1,107 @@ +// +// WebhookDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Representation of a webhook for an inbox. The URL specified will be using by MailSlurp whenever an email is received by the attached inbox. A webhook entity should have a URL that points to your server. Your server should accept HTTP/S POST requests and return a success 200. MailSlurp will retry your webhooks if they fail. See https://api.mailslurp.com/schemas/webhook-payload for the payload schema. */ +@objc public class WebhookDto: NSObject, Codable { + + public enum Method: String, Codable, CaseIterable { + case _get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case options = "OPTIONS" + case trace = "TRACE" + } + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** ID of the Webhook */ + public var _id: UUID + /** User ID of the Webhook */ + public var userId: UUID + /** Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself. */ + public var basicAuth: Bool + /** Name of the webhook */ + public var name: String? + /** The inbox that the Webhook will be triggered by. If null then webhook triggered at account level */ + public var inboxId: UUID? + /** URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema. */ + public var url: String + /** HTTP method that your server endpoint must listen for */ + public var method: Method + /** Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method */ + public var payloadJsonSchema: String + /** When the webhook was created */ + public var createdAt: Date? + public var updatedAt: Date + /** Webhook trigger event name */ + public var eventName: EventName? + public var requestHeaders: WebhookHeaders? + + public init(_id: UUID, userId: UUID, basicAuth: Bool, name: String? = nil, inboxId: UUID? = nil, url: String, method: Method, payloadJsonSchema: String, createdAt: Date?, updatedAt: Date, eventName: EventName? = nil, requestHeaders: WebhookHeaders? = nil) { + self._id = _id + self.userId = userId + self.basicAuth = basicAuth + self.name = name + self.inboxId = inboxId + self.url = url + self.method = method + self.payloadJsonSchema = payloadJsonSchema + self.createdAt = createdAt + self.updatedAt = updatedAt + self.eventName = eventName + self.requestHeaders = requestHeaders + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case basicAuth + case name + case inboxId + case url + case method + case payloadJsonSchema + case createdAt + case updatedAt + case eventName + case requestHeaders + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encode(basicAuth, forKey: .basicAuth) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encode(url, forKey: .url) + try container.encode(method, forKey: .method) + try container.encode(payloadJsonSchema, forKey: .payloadJsonSchema) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encodeIfPresent(eventName, forKey: .eventName) + try container.encodeIfPresent(requestHeaders, forKey: .requestHeaders) + } + + + +} diff --git a/mailslurp/Models/WebhookEmailOpenedPayload.swift b/mailslurp/Models/WebhookEmailOpenedPayload.swift new file mode 100644 index 00000000..4fe89866 --- /dev/null +++ b/mailslurp/Models/WebhookEmailOpenedPayload.swift @@ -0,0 +1,84 @@ +// +// WebhookEmailOpenedPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** EMAIL_OPENED webhook payload. Sent to your webhook url endpoint via HTTP POST when an email containing a tracking pixel is opened and the pixel image is loaded by a reader. */ +@objc public class WebhookEmailOpenedPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + /** Name of the webhook being triggered */ + public var webhookName: String? + /** Id of the inbox that received an email */ + public var inboxId: UUID + /** ID of the tracking pixel */ + public var pixelId: UUID + /** ID of sent email */ + public var sentEmailId: UUID + /** Email address for the recipient of the tracking pixel */ + public var recipient: String + /** Date time of event creation */ + public var createdAt: Date + + public init(messageId: String, webhookId: UUID, eventName: EventName, webhookName: String? = nil, inboxId: UUID, pixelId: UUID, sentEmailId: UUID, recipient: String, createdAt: Date) { + self.messageId = messageId + self.webhookId = webhookId + self.eventName = eventName + self.webhookName = webhookName + self.inboxId = inboxId + self.pixelId = pixelId + self.sentEmailId = sentEmailId + self.recipient = recipient + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case eventName + case webhookName + case inboxId + case pixelId + case sentEmailId + case recipient + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encode(eventName, forKey: .eventName) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(pixelId, forKey: .pixelId) + try container.encode(sentEmailId, forKey: .sentEmailId) + try container.encode(recipient, forKey: .recipient) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/WebhookEmailReadPayload.swift b/mailslurp/Models/WebhookEmailReadPayload.swift new file mode 100644 index 00000000..301b8d85 --- /dev/null +++ b/mailslurp/Models/WebhookEmailReadPayload.swift @@ -0,0 +1,79 @@ +// +// WebhookEmailReadPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** EMAIL_READ webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is read. This happens when an email is requested in full from the API or a user views the email in the dashboard. */ +@objc public class WebhookEmailReadPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + /** Name of the webhook being triggered */ + public var webhookName: String? + /** ID of the email that was received. Use this ID for fetching the email with the `EmailController`. */ + public var emailId: UUID + /** Id of the inbox that received an email */ + public var inboxId: UUID + /** Is the email read */ + public var emailIsRead: Bool + /** Date time of event creation */ + public var createdAt: Date + + public init(messageId: String, webhookId: UUID, eventName: EventName, webhookName: String? = nil, emailId: UUID, inboxId: UUID, emailIsRead: Bool, createdAt: Date) { + self.messageId = messageId + self.webhookId = webhookId + self.eventName = eventName + self.webhookName = webhookName + self.emailId = emailId + self.inboxId = inboxId + self.emailIsRead = emailIsRead + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case eventName + case webhookName + case emailId + case inboxId + case emailIsRead + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encode(eventName, forKey: .eventName) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(emailId, forKey: .emailId) + try container.encode(inboxId, forKey: .inboxId) + try container.encode(emailIsRead, forKey: .emailIsRead) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/WebhookHeaderNameValue.swift b/mailslurp/Models/WebhookHeaderNameValue.swift new file mode 100644 index 00000000..6d0d4383 --- /dev/null +++ b/mailslurp/Models/WebhookHeaderNameValue.swift @@ -0,0 +1,38 @@ +// +// WebhookHeaderNameValue.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Name value pair for webhook header */ +@objc public class WebhookHeaderNameValue: NSObject, Codable { + + /** Name of header */ + public var name: String + /** Value of header */ + public var value: String + + public init(name: String, value: String) { + self.name = name + self.value = value + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case value + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(value, forKey: .value) + } + + + +} diff --git a/mailslurp/Models/WebhookHeaders.swift b/mailslurp/Models/WebhookHeaders.swift new file mode 100644 index 00000000..bab5c120 --- /dev/null +++ b/mailslurp/Models/WebhookHeaders.swift @@ -0,0 +1,33 @@ +// +// WebhookHeaders.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Webhook HTTP headers to include with each request from MailSlurp to your server */ +@objc public class WebhookHeaders: NSObject, Codable { + + /** List of header name value pairs to include with webhook requests */ + public var headers: [WebhookHeaderNameValue] + + public init(headers: [WebhookHeaderNameValue]) { + self.headers = headers + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case headers + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(headers, forKey: .headers) + } + + + +} diff --git a/mailslurp/Models/WebhookNewAttachmentPayload.swift b/mailslurp/Models/WebhookNewAttachmentPayload.swift new file mode 100644 index 00000000..94d22678 --- /dev/null +++ b/mailslurp/Models/WebhookNewAttachmentPayload.swift @@ -0,0 +1,79 @@ +// +// WebhookNewAttachmentPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** NEW_ATTACHMENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains an attachment. You can use the attachmentId to download the attachment. */ +@objc public class WebhookNewAttachmentPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the webhook being triggered */ + public var webhookName: String? + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + /** ID of attachment. Use the `AttachmentController` to */ + public var attachmentId: String + /** Filename of the attachment if present */ + public var name: String + /** Content type of attachment such as 'image/png' or 'application/pdf */ + public var contentType: String + /** Size of attachment in bytes */ + public var contentLength: Int64 + + public init(messageId: String, webhookId: UUID, webhookName: String? = nil, eventName: EventName, attachmentId: String, name: String, contentType: String, contentLength: Int64) { + self.messageId = messageId + self.webhookId = webhookId + self.webhookName = webhookName + self.eventName = eventName + self.attachmentId = attachmentId + self.name = name + self.contentType = contentType + self.contentLength = contentLength + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case webhookName + case eventName + case attachmentId + case name + case contentType + case contentLength + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(eventName, forKey: .eventName) + try container.encode(attachmentId, forKey: .attachmentId) + try container.encode(name, forKey: .name) + try container.encode(contentType, forKey: .contentType) + try container.encode(contentLength, forKey: .contentLength) + } + + + +} diff --git a/mailslurp/Models/WebhookNewContactPayload.swift b/mailslurp/Models/WebhookNewContactPayload.swift new file mode 100644 index 00000000..e355089c --- /dev/null +++ b/mailslurp/Models/WebhookNewContactPayload.swift @@ -0,0 +1,103 @@ +// +// WebhookNewContactPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** NEW_CONTACT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains a recipient that has not been saved as a contact. */ +@objc public class WebhookNewContactPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the webhook being triggered */ + public var webhookName: String? + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + public var contactId: UUID + public var groupId: UUID? + public var firstName: String? + public var lastName: String? + public var company: String? + public var primaryEmailAddress: String? + public var emailAddresses: [String] + public var tags: [String] + public var metaData: AnyCodable? + public var optOut: Bool + public var createdAt: Date + + public init(messageId: String, webhookId: UUID, webhookName: String? = nil, eventName: EventName, contactId: UUID, groupId: UUID? = nil, firstName: String? = nil, lastName: String? = nil, company: String? = nil, primaryEmailAddress: String? = nil, emailAddresses: [String], tags: [String], metaData: AnyCodable? = nil, optOut: Bool, createdAt: Date) { + self.messageId = messageId + self.webhookId = webhookId + self.webhookName = webhookName + self.eventName = eventName + self.contactId = contactId + self.groupId = groupId + self.firstName = firstName + self.lastName = lastName + self.company = company + self.primaryEmailAddress = primaryEmailAddress + self.emailAddresses = emailAddresses + self.tags = tags + self.metaData = metaData + self.optOut = optOut + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case webhookName + case eventName + case contactId + case groupId + case firstName + case lastName + case company + case primaryEmailAddress + case emailAddresses + case tags + case metaData + case optOut + case createdAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(eventName, forKey: .eventName) + try container.encode(contactId, forKey: .contactId) + try container.encodeIfPresent(groupId, forKey: .groupId) + try container.encodeIfPresent(firstName, forKey: .firstName) + try container.encodeIfPresent(lastName, forKey: .lastName) + try container.encodeIfPresent(company, forKey: .company) + try container.encodeIfPresent(primaryEmailAddress, forKey: .primaryEmailAddress) + try container.encode(emailAddresses, forKey: .emailAddresses) + try container.encode(tags, forKey: .tags) + try container.encodeIfPresent(metaData, forKey: .metaData) + try container.encode(optOut, forKey: .optOut) + try container.encode(createdAt, forKey: .createdAt) + } + + + +} diff --git a/mailslurp/Models/WebhookNewEmailPayload.swift b/mailslurp/Models/WebhookNewEmailPayload.swift new file mode 100644 index 00000000..20839810 --- /dev/null +++ b/mailslurp/Models/WebhookNewEmailPayload.swift @@ -0,0 +1,109 @@ +// +// WebhookNewEmailPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** NEW_EMAIL webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to. Use the email ID to fetch the full email body or attachments. */ +@objc public class WebhookNewEmailPayload: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + /** Idempotent message ID. Store this ID locally or in a database to prevent message duplication. */ + public var messageId: String + /** ID of webhook entity being triggered */ + public var webhookId: UUID + /** Name of the event type webhook is being triggered for. */ + public var eventName: EventName + /** Name of the webhook being triggered */ + public var webhookName: String? + /** Id of the inbox that received an email */ + public var inboxId: UUID + /** Id of the domain that received an email */ + public var domainId: UUID? + /** ID of the email that was received. Use this ID for fetching the email with the `EmailController`. */ + public var emailId: UUID + /** Date time of event creation */ + public var createdAt: Date + /** List of `To` recipient email addresses that the email was addressed to. See recipients object for names. */ + public var to: [String] + /** Who the email was sent from. An email address - see fromName for the sender name. */ + public var from: String + /** List of `CC` recipients email addresses that the email was addressed to. See recipients object for names. */ + public var cc: [String] + /** List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names. */ + public var bcc: [String] + /** The subject line of the email message as specified by SMTP subject header */ + public var subject: String? + /** List of attachment meta data objects if attachments present */ + public var attachmentMetaDatas: [AttachmentMetaData] + + public init(messageId: String, webhookId: UUID, eventName: EventName, webhookName: String? = nil, inboxId: UUID, domainId: UUID? = nil, emailId: UUID, createdAt: Date, to: [String], from: String, cc: [String], bcc: [String], subject: String? = nil, attachmentMetaDatas: [AttachmentMetaData]) { + self.messageId = messageId + self.webhookId = webhookId + self.eventName = eventName + self.webhookName = webhookName + self.inboxId = inboxId + self.domainId = domainId + self.emailId = emailId + self.createdAt = createdAt + self.to = to + self.from = from + self.cc = cc + self.bcc = bcc + self.subject = subject + self.attachmentMetaDatas = attachmentMetaDatas + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case messageId + case webhookId + case eventName + case webhookName + case inboxId + case domainId + case emailId + case createdAt + case to + case from + case cc + case bcc + case subject + case attachmentMetaDatas + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(messageId, forKey: .messageId) + try container.encode(webhookId, forKey: .webhookId) + try container.encode(eventName, forKey: .eventName) + try container.encodeIfPresent(webhookName, forKey: .webhookName) + try container.encode(inboxId, forKey: .inboxId) + try container.encodeIfPresent(domainId, forKey: .domainId) + try container.encode(emailId, forKey: .emailId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(to, forKey: .to) + try container.encode(from, forKey: .from) + try container.encode(cc, forKey: .cc) + try container.encode(bcc, forKey: .bcc) + try container.encodeIfPresent(subject, forKey: .subject) + try container.encode(attachmentMetaDatas, forKey: .attachmentMetaDatas) + } + + + +} diff --git a/mailslurp/Models/WebhookProjection.swift b/mailslurp/Models/WebhookProjection.swift new file mode 100644 index 00000000..52eadfa9 --- /dev/null +++ b/mailslurp/Models/WebhookProjection.swift @@ -0,0 +1,67 @@ +// +// WebhookProjection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Representation of a webhook */ +@objc public class WebhookProjection: NSObject, Codable { + + public enum EventName: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + public var name: String? + public var _id: UUID + public var url: String + public var inboxId: UUID? + public var eventName: EventName? + public var createdAt: Date + public var updatedAt: Date + + public init(name: String? = nil, _id: UUID, url: String, inboxId: UUID? = nil, eventName: EventName? = nil, createdAt: Date, updatedAt: Date) { + self.name = name + self._id = _id + self.url = url + self.inboxId = inboxId + self.eventName = eventName + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _id = "id" + case url + case inboxId + case eventName + case createdAt + case updatedAt + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encode(_id, forKey: ._id) + try container.encode(url, forKey: .url) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encodeIfPresent(eventName, forKey: .eventName) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + + +} diff --git a/mailslurp/Models/WebhookRedriveResult.swift b/mailslurp/Models/WebhookRedriveResult.swift new file mode 100644 index 00000000..1f08b3a0 --- /dev/null +++ b/mailslurp/Models/WebhookRedriveResult.swift @@ -0,0 +1,40 @@ +// +// WebhookRedriveResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of retrying webhook */ +@objc public class WebhookRedriveResult: NSObject, Codable { + + public var webhookResultId: UUID + public var success: Bool + public var message: String? + + public init(webhookResultId: UUID, success: Bool, message: String? = nil) { + self.webhookResultId = webhookResultId + self.success = success + self.message = message + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case webhookResultId + case success + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(webhookResultId, forKey: .webhookResultId) + try container.encode(success, forKey: .success) + try container.encodeIfPresent(message, forKey: .message) + } + + + +} diff --git a/mailslurp/Models/WebhookResultDto.swift b/mailslurp/Models/WebhookResultDto.swift new file mode 100644 index 00000000..bd85d832 --- /dev/null +++ b/mailslurp/Models/WebhookResultDto.swift @@ -0,0 +1,123 @@ +// +// WebhookResultDto.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of a webhook notification */ +@objc public class WebhookResultDto: NSObject, Codable { + + public enum HttpMethod: String, Codable, CaseIterable { + case _get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case options = "OPTIONS" + case trace = "TRACE" + } + public enum WebhookEvent: String, Codable, CaseIterable { + case emailReceived = "EMAIL_RECEIVED" + case newEmail = "NEW_EMAIL" + case newContact = "NEW_CONTACT" + case newAttachment = "NEW_ATTACHMENT" + case emailOpened = "EMAIL_OPENED" + case emailRead = "EMAIL_READ" + case bounce = "BOUNCE" + case bounceRecipient = "BOUNCE_RECIPIENT" + case newSms = "NEW_SMS" + } + public enum ResultType: String, Codable, CaseIterable { + case badResponse = "BAD_RESPONSE" + case exception = "EXCEPTION" + case success = "SUCCESS" + } + public var _id: UUID? + public var userId: UUID + public var inboxId: UUID? + public var webhookId: UUID + public var webhookUrl: String + public var messageId: String + public var redriveId: UUID? + public var httpMethod: HttpMethod + public var webhookEvent: WebhookEvent + public var responseStatus: Int? + public var responseStatusNum: NSNumber? { + get { + return responseStatus as NSNumber? + } + } + public var responseTimeMillis: Int64 + public var responseBodyExtract: String? + public var resultType: ResultType? + public var createdAt: Date + public var updatedAt: Date + public var seen: Bool + + public init(_id: UUID? = nil, userId: UUID, inboxId: UUID? = nil, webhookId: UUID, webhookUrl: String, messageId: String, redriveId: UUID? = nil, httpMethod: HttpMethod, webhookEvent: WebhookEvent, responseStatus: Int? = nil, responseTimeMillis: Int64, responseBodyExtract: String? = nil, resultType: ResultType? = nil, createdAt: Date, updatedAt: Date, seen: Bool) { + self._id = _id + self.userId = userId + self.inboxId = inboxId + self.webhookId = webhookId + self.webhookUrl = webhookUrl + self.messageId = messageId + self.redriveId = redriveId + self.httpMethod = httpMethod + self.webhookEvent = webhookEvent + self.responseStatus = responseStatus + self.responseTimeMillis = responseTimeMillis + self.responseBodyExtract = responseBodyExtract + self.resultType = resultType + self.createdAt = createdAt + self.updatedAt = updatedAt + self.seen = seen + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case _id = "id" + case userId + case inboxId + case webhookId + case webhookUrl + case messageId + case redriveId + case httpMethod + case webhookEvent + case responseStatus + case responseTimeMillis + case responseBodyExtract + case resultType + case createdAt + case updatedAt + case seen + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_id, forKey: ._id) + try container.encode(userId, forKey: .userId) + try container.encodeIfPresent(inboxId, forKey: .inboxId) + try container.encode(webhookId, forKey: .webhookId) + try container.encode(webhookUrl, forKey: .webhookUrl) + try container.encode(messageId, forKey: .messageId) + try container.encodeIfPresent(redriveId, forKey: .redriveId) + try container.encode(httpMethod, forKey: .httpMethod) + try container.encode(webhookEvent, forKey: .webhookEvent) + try container.encodeIfPresent(responseStatus, forKey: .responseStatus) + try container.encode(responseTimeMillis, forKey: .responseTimeMillis) + try container.encodeIfPresent(responseBodyExtract, forKey: .responseBodyExtract) + try container.encodeIfPresent(resultType, forKey: .resultType) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(seen, forKey: .seen) + } + + + +} diff --git a/mailslurp/Models/WebhookTestRequest.swift b/mailslurp/Models/WebhookTestRequest.swift new file mode 100644 index 00000000..71a251e1 --- /dev/null +++ b/mailslurp/Models/WebhookTestRequest.swift @@ -0,0 +1,54 @@ +// +// WebhookTestRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Result of webhook test request */ +@objc public class WebhookTestRequest: NSObject, Codable { + + public enum Method: String, Codable, CaseIterable { + case _get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case options = "OPTIONS" + case trace = "TRACE" + } + public var url: String + public var method: Method + public var headers: [String: String] + public var payload: String? + + public init(url: String, method: Method, headers: [String: String], payload: String? = nil) { + self.url = url + self.method = method + self.headers = headers + self.payload = payload + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case url + case method + case headers + case payload + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(url, forKey: .url) + try container.encode(method, forKey: .method) + try container.encode(headers, forKey: .headers) + try container.encodeIfPresent(payload, forKey: .payload) + } + + + +} diff --git a/mailslurp/Models/WebhookTestResponse.swift b/mailslurp/Models/WebhookTestResponse.swift new file mode 100644 index 00000000..9988f782 --- /dev/null +++ b/mailslurp/Models/WebhookTestResponse.swift @@ -0,0 +1,41 @@ +// +// WebhookTestResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Response from webhook test request */ +@objc public class WebhookTestResponse: NSObject, Codable { + + public var statusCode: Int? + public var statusCodeNum: NSNumber? { + get { + return statusCode as NSNumber? + } + } + public var message: String? + + public init(statusCode: Int? = nil, message: String? = nil) { + self.statusCode = statusCode + self.message = message + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case statusCode + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(statusCode, forKey: .statusCode) + try container.encodeIfPresent(message, forKey: .message) + } + + + +} diff --git a/mailslurp/Models/WebhookTestResult.swift b/mailslurp/Models/WebhookTestResult.swift new file mode 100644 index 00000000..7729b516 --- /dev/null +++ b/mailslurp/Models/WebhookTestResult.swift @@ -0,0 +1,40 @@ +// +// WebhookTestResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import AnyCodable + +/** Results of testing a webhook */ +@objc public class WebhookTestResult: NSObject, Codable { + + public var message: String? + public var response: WebhookTestResponse + public var request: WebhookTestRequest + + public init(message: String? = nil, response: WebhookTestResponse, request: WebhookTestRequest) { + self.message = message + self.response = response + self.request = request + } + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + case response + case request + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(message, forKey: .message) + try container.encode(response, forKey: .response) + try container.encode(request, forKey: .request) + } + + + +} diff --git a/mailslurp/OpenISO8601DateFormatter.swift b/mailslurp/OpenISO8601DateFormatter.swift new file mode 100644 index 00000000..e0620807 --- /dev/null +++ b/mailslurp/OpenISO8601DateFormatter.swift @@ -0,0 +1,44 @@ +// +// OpenISO8601DateFormatter.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +// https://stackoverflow.com/a/50281094/976628 +public class OpenISO8601DateFormatter: DateFormatter { + static let withoutSeconds: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" + return formatter + }() + + private func setup() { + calendar = Calendar(identifier: .iso8601) + locale = Locale(identifier: "en_US_POSIX") + timeZone = TimeZone(secondsFromGMT: 0) + dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + } + + override init() { + super.init() + setup() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setup() + } + + override public func date(from string: String) -> Date? { + if let result = super.date(from: string) { + return result + } + return OpenISO8601DateFormatter.withoutSeconds.date(from: string) + } +} diff --git a/mailslurp/SynchronizedDictionary.swift b/mailslurp/SynchronizedDictionary.swift new file mode 100644 index 00000000..acf7ff40 --- /dev/null +++ b/mailslurp/SynchronizedDictionary.swift @@ -0,0 +1,36 @@ +// SynchronizedDictionary.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +internal struct SynchronizedDictionary { + + private var dictionary = [K: V]() + private let queue = DispatchQueue( + label: "SynchronizedDictionary", + qos: DispatchQoS.userInitiated, + attributes: [DispatchQueue.Attributes.concurrent], + autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, + target: nil + ) + + internal subscript(key: K) -> V? { + get { + var value: V? + + queue.sync { + value = self.dictionary[key] + } + + return value + } + set { + queue.sync(flags: DispatchWorkItemFlags.barrier) { + self.dictionary[key] = newValue + } + } + } +} diff --git a/mailslurp/URLSessionImplementations.swift b/mailslurp/URLSessionImplementations.swift new file mode 100644 index 00000000..26140fd4 --- /dev/null +++ b/mailslurp/URLSessionImplementations.swift @@ -0,0 +1,606 @@ +// URLSessionImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if !os(macOS) +import MobileCoreServices +#endif + +class URLSessionRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return URLSessionRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return URLSessionDecodableRequestBuilder.self + } +} + +// Store the URLSession to retain its reference +private var urlSessionStore = SynchronizedDictionary() + +open class URLSessionRequestBuilder: RequestBuilder { + + /** + May be assigned if you want to control the authentication challenges. + */ + public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /** + May be assigned if you want to do any of those things: + - control the task completion + - intercept and handle errors like authorization + - retry the request. + */ + @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the URLSession + configuration. + */ + open func createURLSession() -> URLSession { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + let sessionDelegate = SessionDelegate() + sessionDelegate.credential = credential + sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge + return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the URLRequest + configuration (e.g. to override the cache policy). + */ + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + + guard let url = URL(string: URLString) else { + throw DownloadException.requestMissingURL + } + + var originalRequest = URLRequest(url: url) + + originalRequest.httpMethod = method.rawValue + + headers.forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + buildHeaders().forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) + + return modifiedRequest + } + + override open func execute(_ apiResponseQueue: DispatchQueue = mailslurpAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { + let urlSessionId = UUID().uuidString + // Create a new manager for each request to customize its request header + let urlSession = createURLSession() + urlSessionStore[urlSessionId] = urlSession + + guard let xMethod = HTTPMethod(rawValue: method) else { + fatalError("Unsuported Http method - \(method)") + } + + let encoding: ParameterEncoding + + switch xMethod { + case .get, .head: + encoding = URLEncoding() + + case .options, .post, .put, .patch, .delete, .trace, .connect: + let contentType = headers["Content-Type"] ?? "application/json" + + if contentType == "application/json" { + encoding = JSONDataEncoding() + } else if contentType == "multipart/form-data" { + encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) + } else if contentType == "application/x-www-form-urlencoded" { + encoding = FormURLEncoding() + } else { + fatalError("Unsuported Media Type - \(contentType)") + } + } + + let cleanupRequest = { + urlSessionStore[urlSessionId]?.finishTasksAndInvalidate() + urlSessionStore[urlSessionId] = nil + } + + do { + let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + + let dataTask = urlSession.dataTask(with: request) { data, response, error in + + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { + + taskCompletionShouldRetry(data, response, error) { shouldRetry in + + if shouldRetry { + cleanupRequest() + self.execute(apiResponseQueue, completion) + } else { + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() + } + } + } + } else { + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() + } + } + } + + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { + onProgressReady?(dataTask.progress) + } + + dataTask.resume() + + } catch { + apiResponseQueue.async { + cleanupRequest() + completion(.failure(ErrorResponse.error(415, nil, nil, error))) + } + } + } + + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as? T))) + + case is URL.Type: + do { + + guard error == nil else { + throw DownloadException.responseFailed + } + + guard let data = data else { + throw DownloadException.responseDataMissing + } + + let fileManager = FileManager.default + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try getURL(from: urlRequest) + + var requestPath = try getPath(from: requestURL) + + if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion(.success(Response(response: httpResponse, body: filePath as? T))) + + } catch let requestParserError as DownloadException { + completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) + } catch { + completion(.failure(ErrorResponse.error(400, data, response, error))) + } + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: nil))) + + default: + + completion(.success(Response(response: httpResponse, body: data as? T))) + } + + } + + open func buildHeaders() -> [String: String] { + var httpHeaders: [String: String] = [:] + for (key, value) in headers { + httpHeaders[key] = value + } + for (key, value) in mailslurpAPI.customHeaders { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename: String? + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with: "") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url: URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as? T))) + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: nil))) + + case is Data.Type: + + completion(.success(Response(response: httpResponse, body: data as? T))) + + default: + + guard let data = data, !data.isEmpty else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, response, DecodableRequestBuilderError.emptyDataResponse))) + return + } + + let decodeResult = CodableHelper.decode(T.self, from: data) + + switch decodeResult { + case let .success(decodableObj): + completion(.success(Response(response: httpResponse, body: decodableObj))) + case let .failure(error): + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, error))) + } + } + } +} + +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + + var credential: URLCredential? + + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + + var credential: URLCredential? + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } +} + +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +public protocol ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest +} + +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters else { return urlRequest } + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) + urlRequest.url = urlComponents.url + } + + return urlRequest + } +} + +private class FormDataEncoding: ParameterEncoding { + + let contentTypeForFormPart: (_ fileURL: URL) -> String? + + init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) { + self.contentTypeForFormPart = contentTypeForFormPart + } + + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters, !parameters.isEmpty else { + return urlRequest + } + + let boundary = "Boundary-\(UUID().uuidString)" + + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") + + for (key, value) in parameters { + switch value { + case let fileURL as URL: + + urlRequest = try configureFileUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + fileURL: fileURL + ) + + case let string as String: + + if let data = string.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let number as NSNumber: + + if let data = number.stringValue.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + default: + fatalError("Unprocessable value \(value) with key \(key)") + } + } + + var body = urlRequest.httpBody.orEmpty + + body.append("\r\n--\(boundary)--\r\n") + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureFileUploadRequest(urlRequest: URLRequest, boundary: String, name: String, fileURL: URL) throws -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + let fileData = try Data(contentsOf: fileURL) + + let mimetype = contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) + + let fileName = fileURL.lastPathComponent + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(fileData) + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(data) + + urlRequest.httpBody = body + + return urlRequest + + } + + func mimeType(for url: URL) -> String { + let pathExtension = url.pathExtension + + if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as NSString, nil)?.takeRetainedValue() { + if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() { + return mimetype as String + } + } + return "application/octet-stream" + } + +} + +private class FormURLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + var requestBodyComponents = URLComponents() + requestBodyComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:]) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = requestBodyComponents.query?.data(using: .utf8) + + return urlRequest + } +} + +private extension Data { + /// Append string to Data + /// + /// Rather than littering my code with calls to `dataUsingEncoding` to convert strings to Data, and then add that data to the Data, this wraps it in a nice convenient little extension to Data. This converts using UTF-8. + /// + /// - parameter string: The string to be added to the `Data`. + + mutating func append(_ string: String) { + if let data = string.data(using: .utf8) { + append(data) + } + } +} + +private extension Optional where Wrapped == Data { + var orEmpty: Data { + self ?? Data() + } +} + +extension JSONDataEncoding: ParameterEncoding {} diff --git a/project.yml b/project.yml new file mode 100644 index 00000000..c31d36fb --- /dev/null +++ b/project.yml @@ -0,0 +1,16 @@ +name: mailslurp +targets: + mailslurp: + type: framework + platform: iOS + deploymentTarget: "9.0" + sources: [mailslurp] + info: + path: ./Info.plist + version: 15.13.4 + settings: + APPLICATION_EXTENSION_API_ONLY: true + scheme: {} + dependencies: + - carthage: PromiseKit + - carthage: AnyCodable