Class
Policy
@objc(FSPolicy)
public class Policy: NSObject
Represents a policy object.
See Creating Policies for more information about policies.
Relationships
Conforms To
NSObject
Initializers
init(expiry:)
@objc public convenience init(expiry: Date)
Convenience initializer with expiry time.
init(expiry:call:)
public convenience init(expiry: Date, call: PolicyCall)
Convenience initializer with expiry time and call permissions.
init(expiry:call:handle:url:maxSize:minSize:path:container:)
@nonobjc public init(expiry: Date,
call: PolicyCall? = nil,
handle: String? = nil,
url: String? = nil,
maxSize: UInt? = nil,
minSize: UInt? = nil,
path: String? = nil,
container: String? = nil)
The designated initializer.
Properties
url
public var url: String?
It is possible to create a subset of external URL domains that are allowed to be image/document sources for processing.filestackapi.com transformations.
The URL parameter only applies to processing engine transformations and cannot be used to restrict uploads via the picker to specific domains for example. The filter is a regular expression that must match the input URL. The following is an example of a policy that restricts conversion requests to urls from wikimedia:
{
"expiry":1577836800,
"call":["convert"],
"url":"https://upload\\.wikimedia\\.org/wikipedia/.*"
}
maxSize
public var maxSize: UInt?
The maximum file size in bytes that can be stored by your request.
path
public var path: String?
For policies that store files, a Perl-like regular expression that must match the path that the files will be stored under.
container
public var container: String?
For policies that store files, a Perl-like regular expression that must match the container/bucket that the files will be stored under.