Protocols

The following protocols are available globally.

  • The AWS credentials provider protocol used to provide credentials to the SDK in order to make calls to the AWS services.

    See more

    Declaration

    Objective-C

    @protocol AWSCredentialsProvider <NSObject>

    Swift

    protocol AWSCredentialsProvider : NSObjectProtocol
  • AWSIdentityProvider provides an interface for acquiring an identity token from a provider.

    See more

    Declaration

    Objective-C

    @protocol AWSIdentityProvider <NSObject>

    Swift

    protocol AWSIdentityProvider : NSObjectProtocol
  • AWSIdentityProviderManager provides an interface for creating the logins dictionary for Amazon Cognito Identity.

    See more

    Declaration

    Objective-C

    @protocol AWSIdentityProviderManager <NSObject>

    Swift

    protocol AWSIdentityProviderManager : NSObjectProtocol
  • AWSCognitoCredentialsProviderHelper provides a Cognito specific identity provider. Cognito Identity providers are associated with an identity pool. If the identity pool supports authenticated access, multiple logins may be added to link to the Cognito identity.

    See more

    Declaration

    Objective-C

    @protocol AWSCognitoCredentialsProviderHelper <AWSIdentityProvider,
                                                   AWSIdentityProviderManager>

    Swift

    protocol AWSCognitoCredentialsProviderHelperProtocol : AWSIdentityProvider, AWSIdentityProviderManager
  • The serializer is responsible for turning a log message into binary for writing into a file. It allows storing log messages in a non-text format. The serialier should not be used for filtering or formatting messages! Also, it must be fast!

    See more

    Declaration

    Objective-C

    @protocol AWSDDFileLogMessageSerializer <NSObject>

    Swift

    protocol AWSDDFileLogMessageSerializer : NSObjectProtocol
  • The AWSLogFileManager protocol is designed to allow you to control all aspects of your log files.

    The primary purpose of this is to allow you to do something with the log files after they have been rolled. Perhaps you want to compress them to save disk space. Perhaps you want to upload them to an FTP server. Perhaps you want to run some analytics on the file.

    A default AWSLogFileManager is, of course, provided. The default AWSLogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.

    This protocol provides various methods to fetch the list of log files.

    There are two variants: sorted and unsorted. If sorting is not necessary, the unsorted variant is obviously faster. The sorted variant will return an array sorted by when the log files were created, with the most recently created log file at index 0, and the oldest log file at the end of the array.

    You can fetch only the log file paths (full path including name), log file names (name only), or an array of AWSDDLogFileInfo objects. The AWSDDLogFileInfo class is documented below, and provides a handy wrapper that gives you easy access to various file attributes such as the creation date or the file size.

    See more

    Declaration

    Objective-C

    @protocol AWSDDLogFileManager <NSObject>

    Swift

    protocol AWSDDLogFileManager : NSObjectProtocol
  • This protocol describes a basic logger behavior. Basically, it can log messages, store a logFormatter plus a bunch of optional behaviors. (i.e. flush, get its loggerQueue, get its name, …

    See more

    Declaration

    Objective-C

    @protocol AWSDDLogger <NSObject>

    Swift

    protocol AWSDDLogger : NSObjectProtocol
  • This protocol describes the behavior of a log formatter

    See more

    Declaration

    Objective-C

    @protocol AWSDDLogFormatter <NSObject>

    Swift

    protocol AWSDDLogFormatter : NSObjectProtocol
  • This protocol describes a dynamic logging component

    See more

    Declaration

    Objective-C

    @protocol AWSDRegisteredDynamicLogging

    Swift

    protocol AWSDRegisteredDynamicLogging

AWSDDAtomicCountable

  • Deprecated

    AWSDDAtomicCountable is useless since AWSDDDispatchQueueLogFormatter is always shareable now

    Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSDDAtomicCountable <NSObject>
    
    - (instancetype)initWithDefaultValue:(int32_t)defaultValue;
    - (int32_t)increment;
    - (int32_t)decrement;
    - (int32_t)value;
    
    @end

    Swift

    protocol AWSDDAtomicCountable : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSMTLJSONSerializing
    @required
    
    // Specifies how to map property keys to different key paths in JSON.
    //
    // Subclasses overriding this method should combine their values with those of
    // `super`.
    //
    // Any property keys not present in the dictionary are assumed to match the JSON
    // key that should be used. Any keys associated with NSNull will not participate
    // in JSON serialization.
    //
    // Returns a dictionary mapping property keys to JSON key paths (as strings) or
    // NSNull values.
    + (NSDictionary *)JSONKeyPathsByPropertyKey;
    
    @optional
    
    // Specifies how to convert a JSON value to the given property key. If
    // reversible, the transformer will also be used to convert the property value
    // back to JSON.
    //
    // If the receiver implements a `+<key>JSONTransformer` method, MTLJSONAdapter
    // will use the result of that method instead.
    //
    // Returns a value transformer, or nil if no transformation should be performed.
    + (NSValueTransformer *)JSONTransformerForKey:(NSString *)key;
    
    // Overridden to parse the receiver as a different class, based on information
    // in the provided dictionary.
    //
    // This is mostly useful for class clusters, where the abstract base class would
    // be passed into -[MTLJSONAdapter initWithJSONDictionary:modelClass:], but
    // a subclass should be instantiated instead.
    //
    // JSONDictionary - The JSON dictionary that will be parsed.
    //
    // Returns the class that should be parsed (which may be the receiver), or nil
    // to abort parsing (e.g., if the data is invalid).
    + (Class)classForParsingJSONDictionary:(NSDictionary *)JSONDictionary;
    
    @end

    Swift

    protocol AWSMTLJSONSerializing
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSMTLManagedObjectSerializing
    @required
    
    // The name of the Core Data entity that the receiver serializes to and
    // deserializes from.
    //
    // This method must not return nil.
    + (NSString *)managedObjectEntityName;
    
    // Specifies how to map property keys to different keys on the receiver's
    // +managedObjectEntity.
    //
    // Entity attributes will be mapped to and from the receiver's properties using
    // +entityAttributeTransformerForKey:. Entity relationships will be mapped to
    // and from MTLModel objects using +relationshipModelClassesByPropertyKey.
    // Fetched properties are not supported.
    //
    // Subclasses overriding this method should combine their values with those of
    // `super`.
    //
    // Any property keys not present in the dictionary are assumed to match the
    // entity key that should be used. Any keys associated with NSNull will not
    // participate in managed object serialization.
    //
    // Returns a dictionary mapping property keys to entity keys (as strings) or
    // NSNull values.
    + (NSDictionary *)managedObjectKeysByPropertyKey;
    
    @optional
    
    // Specifies a set of property keys used by the adapter to check for an already
    // existing managed object when converting the MTLModel to its related
    // NSManagedObject.
    //
    // The adapter will first map any keys provided by this method to the correct
    // keys in managedObjectKeysByPropertyKey.
    //
    // The adapter will then perform a fetch request in the provided context for a
    // managed object that matches the MTLModel's managedObjectEntityName and has
    // equal values set for the property keys on the MTLModel.
    //
    // The managed object returned by the fetch request will then be set with all
    // values from the MTLModel that the managed object is being converted from.
    //
    // If a property value of our MTLModel is yet another MTLModel which needs to be
    // converted to a managed object, the class for that MTLModel can also implement
    // this method to perform its own uniqing.
    //
    // For example:
    // 1. An MTLModel subclass has id_number = 10.
    // 2. An NSManagedObject accessible to the adapter's context has idnumber = 10.
    // 3. managedObjectKeysByPropertyKey returns @{@"id_number" : @"idnumber"}
    // 4. propertyKeysForManagedObjectUniquing returns
    //    [NSSet setWithObject:@"id_number"];
    // 5. Then our fetch request may return this managed object (or another managed
    //    object with idnumber = 10).
    //
    // NOTE: If multiple managed objects follow the same uniquing criteria only one
    // of them will be set with our MTLModel's values.
    + (NSSet *)propertyKeysForManagedObjectUniquing;
    
    // Specifies how to convert the given property key to a managed object
    // attribute. If reversible, the transformer will also be used to convert the
    // managed object attribute back to the property.
    //
    // If the receiver implements a `+<key>EntityAttributeTransformer` method,
    // MTLManagedObjectAdapter will use the result of that method instead.
    //
    // Returns a value transformer, or nil if no transformation should be performed.
    + (NSValueTransformer *)entityAttributeTransformerForKey:(NSString *)key;
    
    // Specifies the MTLModel subclasses that should be deserialized to the
    // receiver's property keys when a property key corresponds to an entity
    // relationship.
    //
    // In other words, the dictionary returned by this method is used to decode
    // managed object relationships into MTLModels (or NSArrays or NSSets thereof)
    // set on the receiver.
    //
    // If a property key is omitted from the returned dictionary, but present in
    // +managedObjectKeysByPropertyKey, and the receiver's +managedObjectEntity has
    // a relationship at the corresponding key, an exception will be thrown during
    // deserialization.
    //
    // Subclasses overriding this method should combine their values with those of
    // `super`.
    //
    // Returns a dictionary mapping property keys to the Class objects that should
    // be used.
    + (NSDictionary *)relationshipModelClassesByPropertyKey;
    
    // Overridden to deserialize a different class instead of the receiver, based on
    // information in the provided object.
    //
    // This is mostly useful for class clusters, where the abstract base class would
    // be passed into +[MTLManagedObjectAdapter
    // modelOfClass:fromManagedObject:error:], but a subclass should be instantiated
    // instead.
    //
    // managedObject - The object that will be deserialized.
    //
    // Returns the class that should be instantiated (which may be the receiver), or
    // nil to abort parsing (e.g., if the data is invalid).
    + (Class)classForDeserializingManagedObject:(NSManagedObject *)managedObject;
    
    // Overriden when merging the value of the given key on the receiver with the
    // value of the same key from the given `NSManagedObject` requires custom
    // handling.
    //
    // By default, this method is not implemented, and precedence will be given to
    // the value of the receiving model implicitly.
    //
    // When implemented, this method is called when an existing `NSManagedObject`
    // is found for the receiving model, before updating the `NSManagedObject`'s
    // properties.
    //
    // When implementing, you should use `+managedObjectKeysByPropertyKey` to map
    // the given `key` to the appropriate `NSManagedObject` property.
    - (void)mergeValueForKey:(NSString *)key fromManagedObject:(NSManagedObject *)managedObject;
    
    // Overriden when merging values on the receiver with the given
    // `NSManagedObject` requires custom handling.
    //
    // By default, this method is not implemented, and precedence will be given to
    // the values of the receiving model implicitly.
    //
    // When implemented, this method is called when an existing `NSManagedObject`
    // is found for the receiving model, before updating the `NSManagedObject`'s
    // properties.
    //
    // When implementing, you should use `+managedObjectKeysByPropertyKey` to map
    // the given `key` to the appropriate `NSManagedObject` property.
    //
    // If you have also implemented `mergeValueForKey:fromManagedObject:` you have
    // to make sure to call `mergeValueForKey:fromManagedObject:` from this method
    // when appropriate.
    - (void)mergeValuesForKeysFromManagedObject:(NSManagedObject *)managedObject;
    
    @end

    Swift

    protocol AWSMTLManagedObjectSerializing

Protocols

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSURLRequestSerializer <NSObject>
    
    @required
    - (AWSTask *)validateRequest:(NSURLRequest *)request;
    - (AWSTask *)serializeRequest:(NSMutableURLRequest *)request
                         headers:(NSDictionary *)headers
                      parameters:(NSDictionary *)parameters;
    
    @end

    Swift

    protocol AWSURLRequestSerializer : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSNetworkingRequestInterceptor <NSObject>
    
    @required
    - (AWSTask *)interceptRequest:(NSMutableURLRequest *)request;
    
    @end

    Swift

    protocol AWSNetworkingRequestInterceptorProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSNetworkingHTTPResponseInterceptor <NSObject>
    
    @required
    - (AWSTask *)interceptResponse:(NSHTTPURLResponse *)response
                             data:(id)data
                  originalRequest:(NSURLRequest *)originalRequest
                   currentRequest:(NSURLRequest *)currentRequest;
    
    @end

    Swift

    protocol AWSNetworkingHTTPResponseInterceptor : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSHTTPURLResponseSerializer <NSObject>
    
    @required
    
    - (BOOL)validateResponse:(NSHTTPURLResponse *)response
                 fromRequest:(NSURLRequest *)request
                        data:(id)data
                       error:(NSError *__autoreleasing *)error;
    - (id)responseObjectForResponse:(NSHTTPURLResponse *)response
                    originalRequest:(NSURLRequest *)originalRequest
                     currentRequest:(NSURLRequest *)currentRequest
                               data:(id)data
                              error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    protocol AWSHTTPURLResponseSerializer : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSURLRequestRetryHandler <NSObject>
    
    @required
    
    @property (nonatomic, assign) uint32_t maxRetryCount;
    
    - (AWSNetworkingRetryType)shouldRetry:(uint32_t)currentRetryCount
                          originalRequest:(AWSNetworkingRequest *)originalRequest
                                 response:(NSHTTPURLResponse *)response
                                     data:(NSData *)data
                                    error:(NSError *)error;
    
    - (NSTimeInterval)timeIntervalForRetry:(uint32_t)currentRetryCount
                                  response:(NSHTTPURLResponse *)response
                                      data:(NSData *)data
                                     error:(NSError *)error;
    
    @optional
    
    - (NSDictionary *)resetParameters:(NSDictionary *)parameters;
    
    @end

    Swift

    protocol AWSURLRequestRetryHandler : NSObjectProtocol