Filestack Documentation

Class Policy

@objc(FSPolicy)
public class Policy: NSObject  

Represents a policy object.

See Creating Policies for more information about policies.

Policy Policy NSObject NSObject Policy->NSObject

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:​max​Size:​min​Size:​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

expiry

public let expiry: Date

The expiration date for the policy.

call

public let call: PolicyCall? 

The calls that you allow this policy to make.

handle

public var handle: String? 

The unique file handle that you would like to access.

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/.*"
}

max​Size

public var maxSize: UInt? 

The maximum file size in bytes that can be stored by your request.

min​Size

public var minSize: UInt? 

The minimum file size 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.

description

override public var description: String  

:nodoc: