ArcGIS Runtime SDK for iOS: AGSPortalItem.h Source File
ArcGIS Runtime SDK for iOS  100.11
AGSPortalItem.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 2021 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 
33 
34 
39 typedef NS_ENUM(NSInteger, AGSPortalItemRelationship) {
66 };
67 
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 
111 -(instancetype)initWithPortal:(AGSPortal*)portal itemID:(NSString*)itemID;
112 
125 +(instancetype)portalItemWithPortal:(AGSPortal*)portal itemID:(NSString*)itemID;
126 
134 -(instancetype)initWithPortal:(AGSPortal*)portal type:(AGSPortalItemType)type;
135 
144 +(instancetype)portalItemWithPortal:(AGSPortal*)portal type:(AGSPortalItemType)type;
145 
151 +(nullable AGSPortalItem *)fromJSON:(id)JSONObject withPortal:(AGSPortal*)portal error:(NSError**)error;
152 
161 -(nullable instancetype)initWithURL:(NSURL*)URL;
162 
172 +(nullable instancetype)portalItemWithURL:(NSURL*)URL;
173 
174 #pragma mark -
175 #pragma mark properties
176 
180 @property (nonatomic, strong, readonly) AGSPortal *portal;
181 
185 @property (nullable, nonatomic, strong, readonly) NSURL *serviceURL;
186 
190 @property (nonatomic, copy, readonly) NSString *folderID;
191 
195 @property (nonatomic, copy, readwrite) NSString *owner;
196 
200 @property (nonatomic, assign, readwrite) AGSPortalItemType type;
201 
205 @property (nonatomic, copy, readonly) NSString *typeName;
206 
210 @property (nullable, nonatomic, strong, readonly) NSLocale *locale;
211 
215 @property (nonatomic, assign, readonly) long long size;
216 
220 @property (nonatomic, assign, readonly) NSInteger commentCount;
221 
225 @property (nonatomic, assign, readonly) NSInteger ratingCount;
226 
230 @property (nonatomic, assign, readonly) CGFloat averageRating;
231 
236 @property (nonatomic, assign, readonly) NSInteger viewCount;
237 
244 @property (nonatomic, assign, readonly) AGSPortalAccess access;
245 
249 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalItemComment*> *comments;
250 
254 @property (nonatomic, assign, readonly) BOOL commentsEnabled;
255 
262 @property (nullable, nonatomic, strong, readonly) AGSLoadableValue *userRating;
263 
268 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalGroup*> *adminGroups;
269 
274 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalGroup*> *memberGroups;
275 
281 @property (nullable, nonatomic, copy, readonly) NSArray<AGSPortalGroup*> *otherGroups;
282 
283 #pragma mark -
284 #pragma mark methods
285 
291 -(id<AGSCancelable>)fetchCommentsWithCompletion:(nullable void(^)(NSArray<AGSPortalItemComment*> * __nullable comments, NSError * __nullable error))completion;
292 
298 -(id<AGSCancelable>)fetchGroupsWithCompletion:(nullable void(^)(NSArray<AGSPortalGroup*> * __nullable adminGroups, NSArray<AGSPortalGroup*> * __nullable memberGroups, NSArray<AGSPortalGroup*> * __nullable otherGroups, NSError * __nullable error))completion;
299 
308 - (id<AGSCancelable>)fetchRelatedItemsWithRelationship:(AGSPortalItemRelationship)relationship
309  direction:(AGSPortalItemRelationshipDirection)direction
310  completion:(void(^)(NSArray<AGSPortalItem *> * __nullable result, NSError * __nullable error))completion;
311 
320 - (id<AGSCancelable>)fetchRelatedItemsWithRelationships:(NSArray<NSValue *> *)relationships
321  direction:(AGSPortalItemRelationshipDirection)direction
322  completion:(void(^)(NSArray<AGSPortalItem *> * __nullable result, NSError * __nullable error))completion;
323 
334 -(id<AGSCancelable>)addRating:(CGFloat)rating completion:(nullable void(^)(NSError * __nullable error))completion;
335 
342 -(id<AGSCancelable>)addComment:(NSString*)comment completion:(nullable void(^)(AGSPortalItemComment * __nullable resultComment, NSError * __nullable error))completion;
343 
352 -(id<AGSCancelable>)updateDataWithJSON:(id)json completion:(nullable void(^)(NSError * __nullable error))completion;
353 
362 -(id<AGSCancelable>)updateData:(NSData*)data completion:(nullable void(^)(NSError * __nullable error))completion;
363 
378 -(id<AGSCancelable>)shareWithEveryone:(BOOL)everyone org:(BOOL)org completion:(nullable void(^)(NSError * __nullable error))completion;
379 
390 -(id<AGSCancelable>)shareWithGroups:(NSArray<AGSPortalGroup*> *)groups completion:(nullable void(^)(NSArray<AGSPortalGroup*> * __nullable excludedGroups, NSError * __nullable error))completion;
391 
400 -(id<AGSCancelable>)unshareWithCompletion:(nullable void(^)(NSError * __nullable error))completion;
401 
412 -(id<AGSCancelable>)unshareWithGroups:(NSArray<AGSPortalGroup*> *)groups completion:(nullable void(^)(NSArray<AGSPortalGroup*> * __nullable excludedGroups, NSError * __nullable error))completion;
413 
419 -(__nullable id)toJSON:(NSError**)error;
420 
421 @end
422 
424 
432 -(instancetype)initWithPortal:(AGSPortal *)portal ;
433 
441 +(instancetype)portalItemWithPortal:(AGSPortal *)portal ;
442 
447 @property (nonatomic, copy, readwrite) NSString *accessAndUseConstraintsHtml ;
452 @property (nonatomic, copy, readonly) NSString *GUID __deprecated;
453 
454 @end
455 
457 
464 + (instancetype _Null_unspecified)ags_valueWithPortalItemRelationship:(AGSPortalItemRelationship)relationship;
465 
471 
472 @end
473 
474 
AGSPortalItemRelationshipDirection
Definition: AGSPortalItem.h:72
@ AGSPortalItemRelationshipDirectionReverse
Definition: AGSPortalItem.h:74
@ AGSPortalItemRelationshipDirectionForward
Definition: AGSPortalItem.h:73
AGSPortalItemRelationship
Definition: AGSPortalItem.h:39
@ AGSPortalItemRelationshipWMAToCode
Definition: AGSPortalItem.h:41
@ AGSPortalItemRelationshipStyleToStyle
Definition: AGSPortalItem.h:50
@ AGSPortalItemRelationshipServiceToData
Definition: AGSPortalItem.h:44
@ AGSPortalItemRelationshipWorkforceMapToFeatureService
Definition: AGSPortalItem.h:61
@ AGSPortalItemRelationshipTrackViewToMap
Definition: AGSPortalItem.h:59
@ AGSPortalItemRelationshipAreaToPackage
Definition: AGSPortalItem.h:55
@ AGSPortalItemRelationshipWebStyleToDesktopStyle
Definition: AGSPortalItem.h:63
@ AGSPortalItemRelationshipSurveyToData
Definition: AGSPortalItem.h:53
@ AGSPortalItemRelationshipAreaToCustomPackage
Definition: AGSPortalItem.h:58
@ AGSPortalItemRelationshipMapToFeatureCollection
Definition: AGSPortalItem.h:42
@ AGSPortalItemRelationshipServiceToLayer
Definition: AGSPortalItem.h:57
@ AGSPortalItemRelationshipItemToReport
Definition: AGSPortalItem.h:48
@ AGSPortalItemRelationshipThemeToStory
Definition: AGSPortalItem.h:62
@ AGSPortalItemRelationshipListedToProvisioned
Definition: AGSPortalItem.h:49
@ AGSPortalItemRelationshipSolutionToItem
Definition: AGSPortalItem.h:64
@ AGSPortalItemRelationshipServiceToService
Definition: AGSPortalItem.h:45
@ AGSPortalItemRelationshipSurveyToService
Definition: AGSPortalItem.h:52
@ AGSPortalItemRelationshipMapToArea
Definition: AGSPortalItem.h:56
@ AGSPortalItemRelationshipMobileAppToCode
Definition: AGSPortalItem.h:43
@ AGSPortalItemRelationshipMapToAppConfig
Definition: AGSPortalItem.h:46
@ AGSPortalItemRelationshipSurveyAddInToData
Definition: AGSPortalItem.h:60
@ AGSPortalItemRelationshipServiceToRoute
Definition: AGSPortalItem.h:54
@ AGSPortalItemRelationshipMapToService
Definition: AGSPortalItem.h:40
@ AGSPortalItemRelationshipItemToAttachment
Definition: AGSPortalItem.h:47
@ AGSPortalItemRelationshipAPIKeyToItem
Definition: AGSPortalItem.h:65
@ AGSPortalItemRelationshipServiceToStyle
Definition: AGSPortalItem.h:51
AGSPortalAccess
Definition: AGSPortalTypes.h:269
AGSPortalItemType
Definition: AGSPortalTypes.h:33
Definition: AGSPortalItem.h:423
Definition: AGSPortalItem.h:456
AGSPortalItemRelationship ags_portalItemRelationshipValue()
A geometry that represents a rectangular shape.
Definition: AGSEnvelope.h:55
Object representing a unit of content.
Definition: AGSItem.h:44
A value that is loaded asynchronously.
Definition: AGSLoadableValue.h:35
Represents a group within the Portal or Organization.
Definition: AGSPortalGroup.h:65
An Object representing a Portal for ArcGIS.
Definition: AGSPortal.h:105
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:205
AGSPortalItemType type
Definition: AGSPortalItem.h:200
NSArray< AGSPortalGroup * > * otherGroups
Definition: AGSPortalItem.h:281
NSArray< AGSPortalGroup * > * memberGroups
Definition: AGSPortalItem.h:274
NSInteger commentCount
Definition: AGSPortalItem.h:220
NSInteger ratingCount
Definition: AGSPortalItem.h:225
long long size
Definition: AGSPortalItem.h:215
AGSLoadableValue * userRating
Definition: AGSPortalItem.h:262
NSArray< AGSPortalItemComment * > * comments
Definition: AGSPortalItem.h:249
AGSPortal * portal
Definition: AGSPortalItem.h:180
AGSPortalAccess access
Definition: AGSPortalItem.h:244
NSLocale * locale
Definition: AGSPortalItem.h:210
NSString * owner
Definition: AGSPortalItem.h:195
NSURL * serviceURL
Definition: AGSPortalItem.h:185
CGFloat averageRating
Definition: AGSPortalItem.h:230
NSArray< AGSPortalGroup * > * adminGroups
Definition: AGSPortalItem.h:268
NSInteger viewCount
Definition: AGSPortalItem.h:236
BOOL commentsEnabled
Definition: AGSPortalItem.h:254
NSString * folderID
Definition: AGSPortalItem.h:190
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