ArcGIS Runtime SDK for iOS: AGSPortalItem.h Source File
ArcGIS Runtime SDK for iOS  100.15
AGSPortalItem.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 2022 ESRI
3 
4  All rights reserved under the copyright laws of the United States
5  and applicable international laws, treaties, and conventions.
6 
7  This material is licensed for use under the Esri Master License
8  Agreement (MLA), and is bound by the terms of that agreement.
9  You may redistribute and use this code without modification,
10  provided you adhere to the terms of the MLA and include this
11  copyright notice.
12 
13  See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
14 
15  For additional information, contact:
16  Environmental Systems Research Institute, Inc.
17  Attn: Contracts and Legal Services Department
18  380 New York Street
19  Redlands, California, 92373
20  USA
21 
22  email: contracts@esri.com
23  */
24  //Required for Globals API doc
26 
27 #import <Foundation/Foundation.h>
28 #import <ArcGIS/AGSItem.h>
29 #import <ArcGIS/AGSLoadable.h>
30 #import <ArcGIS/AGSJSONSerializable.h>
31 #import <ArcGIS/AGSPortalTypes.h>
32 #import <ArcGIS/AGSCancelable.h>
33 
34 
35 
40 typedef NS_ENUM(NSInteger, AGSPortalItemRelationship) {
67 };
68 
72 typedef NS_ENUM(NSInteger, AGSPortalItemRelationshipDirection) {
75 };
76 
77 
78 @class AGSEnvelope;
79 @class AGSPortal;
81 @class AGSLoadableValue;
82 @class AGSPortalGroup;
83 
94 
95 #pragma mark -
96 #pragma mark initializers
97 
98 
99 
113 -(instancetype)initWithPortal:(AGSPortal*)portal itemID:(NSString*)itemID;
114 
128 +(instancetype)portalItemWithPortal:(AGSPortal*)portal itemID:(NSString*)itemID;
129 
137 -(instancetype)initWithPortal:(AGSPortal*)portal type:(AGSPortalItemType)type;
138 
147 +(instancetype)portalItemWithPortal:(AGSPortal*)portal type:(AGSPortalItemType)type;
148 
154 +(nullable AGSPortalItem *)fromJSON:(id)JSONObject withPortal:(AGSPortal*)portal error:(NSError**)error;
155 
173 -(nullable instancetype)initWithURL:(NSURL*)URL;
174 
193 +(nullable instancetype)portalItemWithURL:(NSURL*)URL;
194 
195 #pragma mark -
196 #pragma mark properties
197 
201 @property (nonatomic, strong, readonly) AGSPortal *portal;
202 
206 @property (nullable, nonatomic, strong, readonly) NSURL *serviceURL;
207 
211 @property (nonatomic, copy, readonly) NSString *folderID;
212 
216 @property (nonatomic, copy, readwrite) NSString *owner;
217 
221 @property (nonatomic, assign, readwrite) AGSPortalItemType type;
222 
226 @property (nonatomic, copy, readonly) NSString *typeName;
227 
231 @property (nullable, nonatomic, strong, readonly) NSLocale *locale;
232 
236 @property (nonatomic, assign, readonly) long long size;
237 
241 @property (nonatomic, assign, readonly) NSInteger commentCount;
242 
246 @property (nonatomic, assign, readonly) NSInteger ratingCount;
247 
251 @property (nonatomic, assign, readonly) CGFloat averageRating;
252 
257 @property (nonatomic, assign, readonly) NSInteger viewCount;
258 
266 @property (nonatomic, assign, readonly) AGSPortalAccess access;
267 
271 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalItemComment*> *comments;
272 
276 @property (nonatomic, assign, readonly) BOOL commentsEnabled;
277 
284 @property (nullable, nonatomic, strong, readonly) AGSLoadableValue *userRating;
285 
290 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalGroup*> *adminGroups;
291 
296 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalGroup*> *memberGroups;
297 
303 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalGroup*> *otherGroups;
304 
305 #pragma mark -
306 #pragma mark methods
307 
314 -(id<AGSCancelable>)fetchCommentsWithCompletion:(nullable void(^)(NSArray<AGSPortalItemComment*> * __nullable comments, NSError * __nullable error))completion;
315 
323 -(id<AGSCancelable>)fetchGroupsWithCompletion:(nullable void(^)(NSArray<AGSPortalGroup*> * __nullable adminGroups, NSArray<AGSPortalGroup*> * __nullable memberGroups, NSArray<AGSPortalGroup*> * __nullable otherGroups, NSError * __nullable error))completion;
324 
334 - (id<AGSCancelable>)fetchRelatedItemsWithRelationship:(AGSPortalItemRelationship)relationship
335  direction:(AGSPortalItemRelationshipDirection)direction
336  completion:(void(^)(NSArray<AGSPortalItem *> * __nullable result, NSError * __nullable error))completion;
337 
347 - (id<AGSCancelable>)fetchRelatedItemsWithRelationships:(NSArray<NSValue *> *)relationships
348  direction:(AGSPortalItemRelationshipDirection)direction
349  completion:(void(^)(NSArray<AGSPortalItem *> * __nullable result, NSError * __nullable error))completion;
350 
363 -(id<AGSCancelable>)addRating:(CGFloat)rating completion:(nullable void(^)(NSError * __nullable error))completion;
364 
372 -(id<AGSCancelable>)addComment:(NSString*)comment completion:(nullable void(^)(AGSPortalItemComment * __nullable resultComment, NSError * __nullable error))completion;
373 
384 -(id<AGSCancelable>)updateDataWithJSON:(id)json completion:(nullable void(^)(NSError * __nullable error))completion;
385 
396 -(id<AGSCancelable>)updateData:(NSData*)data completion:(nullable void(^)(NSError * __nullable error))completion;
397 
412 -(id<AGSCancelable>)shareWithEveryone:(BOOL)everyone org:(BOOL)org completion:(nullable void(^)(NSError * __nullable error))completion;
413 
425 -(id<AGSCancelable>)shareWithGroups:(NSArray<AGSPortalGroup*> *)groups completion:(nullable void(^)(NSArray<AGSPortalGroup*> * __nullable excludedGroups, NSError * __nullable error))completion;
426 
435 -(id<AGSCancelable>)unshareWithCompletion:(nullable void(^)(NSError * __nullable error))completion;
436 
448 -(id<AGSCancelable>)unshareWithGroups:(NSArray<AGSPortalGroup*> *)groups completion:(nullable void(^)(NSArray<AGSPortalGroup*> * __nullable excludedGroups, NSError * __nullable error))completion;
449 
454 -(__nullable id)toJSON:(NSError**)error;
455 
456 @end
457 
459 
467 -(instancetype)initWithPortal:(AGSPortal *)portal ;
468 
476 +(instancetype)portalItemWithPortal:(AGSPortal *)portal ;
477 
482 @property (nonatomic, copy, readwrite) NSString *accessAndUseConstraintsHtml ;
483 
488 @property (nonatomic, copy, readonly) NSString *GUID __deprecated;
489 
490 @end
491 
493 
499 + (instancetype _Null_unspecified)ags_valueWithPortalItemRelationship:(AGSPortalItemRelationship)relationship;
500 
505 
506 @end
507 
508 
AGSPortalItemRelationshipDirection
Definition: AGSPortalItem.h:72
@ AGSPortalItemRelationshipDirectionReverse
Definition: AGSPortalItem.h:74
@ AGSPortalItemRelationshipDirectionForward
Definition: AGSPortalItem.h:73
AGSPortalItemRelationship
Definition: AGSPortalItem.h:40
@ AGSPortalItemRelationshipWMAToCode
Definition: AGSPortalItem.h:42
@ AGSPortalItemRelationshipStyleToStyle
Definition: AGSPortalItem.h:51
@ AGSPortalItemRelationshipServiceToData
Definition: AGSPortalItem.h:45
@ AGSPortalItemRelationshipWorkforceMapToFeatureService
Definition: AGSPortalItem.h:62
@ AGSPortalItemRelationshipTrackViewToMap
Definition: AGSPortalItem.h:60
@ AGSPortalItemRelationshipAreaToPackage
Definition: AGSPortalItem.h:56
@ AGSPortalItemRelationshipWebStyleToDesktopStyle
Definition: AGSPortalItem.h:64
@ AGSPortalItemRelationshipSurveyToData
Definition: AGSPortalItem.h:54
@ AGSPortalItemRelationshipAreaToCustomPackage
Definition: AGSPortalItem.h:59
@ AGSPortalItemRelationshipMapToFeatureCollection
Definition: AGSPortalItem.h:43
@ AGSPortalItemRelationshipServiceToLayer
Definition: AGSPortalItem.h:58
@ AGSPortalItemRelationshipItemToReport
Definition: AGSPortalItem.h:49
@ AGSPortalItemRelationshipThemeToStory
Definition: AGSPortalItem.h:63
@ AGSPortalItemRelationshipListedToProvisioned
Definition: AGSPortalItem.h:50
@ AGSPortalItemRelationshipSolutionToItem
Definition: AGSPortalItem.h:65
@ AGSPortalItemRelationshipServiceToService
Definition: AGSPortalItem.h:46
@ AGSPortalItemRelationshipSurveyToService
Definition: AGSPortalItem.h:53
@ AGSPortalItemRelationshipMapToArea
Definition: AGSPortalItem.h:57
@ AGSPortalItemRelationshipMobileAppToCode
Definition: AGSPortalItem.h:44
@ AGSPortalItemRelationshipMapToAppConfig
Definition: AGSPortalItem.h:47
@ AGSPortalItemRelationshipSurveyAddInToData
Definition: AGSPortalItem.h:61
@ AGSPortalItemRelationshipServiceToRoute
Definition: AGSPortalItem.h:55
@ AGSPortalItemRelationshipMapToService
Definition: AGSPortalItem.h:41
@ AGSPortalItemRelationshipItemToAttachment
Definition: AGSPortalItem.h:48
@ AGSPortalItemRelationshipAPIKeyToItem
Definition: AGSPortalItem.h:66
@ AGSPortalItemRelationshipServiceToStyle
Definition: AGSPortalItem.h:52
AGSPortalAccess
Definition: AGSPortalTypes.h:269
AGSPortalItemType
Definition: AGSPortalTypes.h:33
Definition: AGSPortalItem.h:458
Definition: AGSPortalItem.h:492
AGSPortalItemRelationship ags_portalItemRelationshipValue()
A geometry that represents a rectangular shape.
Definition: AGSEnvelope.h:55
Object representing a unit of content.
Definition: AGSItem.h:43
A value that is loaded asynchronously.
Definition: AGSLoadableValue.h:35
Represents a group within the Portal or Organization.
Definition: AGSPortalGroup.h:64
An object representing a portal for ArcGIS.
Definition: AGSPortal.h:98
A comment for a portal's item.
Definition: AGSPortalItemComment.h:36
Object representing a unit of content in an ArcGIS portal.
Definition: AGSPortalItem.h:93
NSString * typeName
Definition: AGSPortalItem.h:226
AGSPortalItemType type
Definition: AGSPortalItem.h:221
NSArray< AGSPortalGroup * > * otherGroups
Definition: AGSPortalItem.h:303
NSArray< AGSPortalGroup * > * memberGroups
Definition: AGSPortalItem.h:296
NSInteger commentCount
Definition: AGSPortalItem.h:241
NSInteger ratingCount
Definition: AGSPortalItem.h:246
long long size
Definition: AGSPortalItem.h:236
AGSLoadableValue * userRating
Definition: AGSPortalItem.h:284
NSArray< AGSPortalItemComment * > * comments
Definition: AGSPortalItem.h:271
AGSPortal * portal
Definition: AGSPortalItem.h:201
AGSPortalAccess access
Definition: AGSPortalItem.h:266
NSLocale * locale
Definition: AGSPortalItem.h:231
NSString * owner
Definition: AGSPortalItem.h:216
NSURL * serviceURL
Definition: AGSPortalItem.h:206
CGFloat averageRating
Definition: AGSPortalItem.h:251
NSArray< AGSPortalGroup * > * adminGroups
Definition: AGSPortalItem.h:290
NSInteger viewCount
Definition: AGSPortalItem.h:257
BOOL commentsEnabled
Definition: AGSPortalItem.h:276
NSString * folderID
Definition: AGSPortalItem.h:211
A protocol exposed by operations that allow cancellation.
Definition: AGSCancelable.h:38
A protocol to convert objects to and from JSON.
Definition: AGSJSONSerializable.h:38
A protocol adopted by classes that can load data asynchronously.
Definition: AGSLoadable.h:72