blob: 11395181704caf383c308b93024ff8690a132bd8 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
@interface UGActivity : NSObject
// In order for an activity to be valid, you must call setBasics and one of the setActor functions.
// In all cases, the return value will be YES if the function succeeded and NO if there
// was a problem with the set. A response of NO will usually mean you sent nil for a required field.
// these are the basics of the activity.
// verb: the action being taken
// category: The type of activity it is
// content: The content of this activity. The format is defined by the category
// title: The title of this category.
-(BOOL) setBasics: (NSString *)verb category:(NSString *)category content:(NSString *)content title:(NSString *)title;
// actorUserName: The username of the entity doing this activity
// actorDisplayName: The visible name of the entity doing this activity
// actorUUID: The UUID of the entity doing this activity
-(BOOL) setActorInfo: (NSString *)actorUserName actorDisplayName:(NSString *)actorDisplayName actorUUID:(NSString *)actorUUID;
// actorUserName: The username of the entity doing this activity
// actorDisplayName: The visible name of the entity doing this activity
// actorUUID: The UUID of the entity doing this activity
-(BOOL) setActorInfo: (NSString *)actorUserName actorDisplayName:(NSString *)actorDisplayName actorEmail:(NSString *)actorEmail;
// Associating an object with the Activity is optional. You don't have to supply an object at all.
// objectType: the type of the object associated with this activity
// displayName: The visible name of the object associated with this activity
// entityType: the entity type of this object within UserGrid. The actual type that it is stored under
// entityUUID: The uuid of the object associated with this activity
-(BOOL)setObjectInfo: (NSString *)objectType displayName:(NSString *)displayName entityType:(NSString *)entityType entityUUID:(NSString *)entityUUID;
// similar to the function above, but it takes an arbitrary object content (which can be new and unique) instead of an already-defined object
-(BOOL)setObjectInfo: (NSString *)objectType displayName:(NSString *)displayName objectContent:(NSString *)objectContent;
// similar to the other two functions, but simply has the type and displayName. In this case, the
// "content" value supplied in setBasics will be used as the object content.
-(BOOL)setObjectInfo: (NSString *)objectType displayName:(NSString *)displayName;
// returns YES if this is properly set up. NO if it has not been properly set up
-(BOOL)isValid;
// turn this object in to an NSDictionary. Used internally by UGClient
-(NSDictionary *)toNSDictionary;
@end