ArcGIS Runtime SDK for iOS: AGSRequestOperation.h Source File
ArcGIS Runtime SDK for iOS  100.11
AGSRequestOperation.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/AGSObservableOperation.h>
29 #import <ArcGIS/AGSCancelable.h>
30 
31 
32 
37 typedef NS_ENUM(NSInteger, AGSRequestHTTPMethod) {
41 };
42 
43 @class AGSCredential;
45 @protocol AGSRemoteResource;
46 @protocol AGSLoadable;
47 
67 @interface AGSRequestOperation : AGSObservableOperation <AGSCancelable, NSProgressReporting>
68 
69 #pragma mark -
70 #pragma mark initializers
71 
72 
73 
81 - (instancetype)initWithRemoteResource:(nullable id<AGSRemoteResource>)remoteResource
82  request:(NSURLRequest *)request NS_DESIGNATED_INITIALIZER;
83 
89 - (instancetype)initWithURL:(NSURL *)url;
90 
100 -(instancetype)initWithRemoteResource:(nullable id<AGSRemoteResource>)remoteResource
101  URL:(NSURL *)URL
102  queryParameters:(nullable NSDictionary<NSString*,id> *)queryParameters;
103 
114 -(instancetype)initWithRemoteResource:(nullable id<AGSRemoteResource>)remoteResource
115  URL:(NSURL*)URL
116  queryParameters:(nullable NSDictionary<NSString*,id> *)queryParameters
117  method:(AGSRequestHTTPMethod)method NS_DESIGNATED_INITIALIZER;
118 #pragma mark -
119 #pragma mark properties
120 
124 @property (nonatomic, strong, readonly) NSURL *URL;
125 
129 @property (nullable, copy, readonly) NSDictionary<NSString*,id> *queryParameters;
130 
135 @property (nonatomic, assign, readwrite) AGSRequestHTTPMethod method;
136 
140 @property (nullable, nonatomic, strong, readonly) NSURLRequest *request;
141 
145 @property (nullable, nonatomic, strong, readwrite) AGSCredential *credential;
146 
151 @property (nonatomic, strong, readwrite) AGSRequestConfiguration *requestConfiguration;
152 
156 @property (nullable, nonatomic, weak, readonly) id<AGSRemoteResource> remoteResource;
157 
161 @property (nullable, nonatomic, weak, readwrite) id<AGSLoadable> loadDependency;
162 
166 @property (nullable, nonatomic, strong, readonly) NSURLResponse *response;
167 
172 @property (nullable, nonatomic, strong, readwrite) NSURL *outputFileURL;
173 
177 @property (nullable, nonatomic, copy, readwrite) NSString *sessionID;
178 
182 @property (nonatomic, assign, readonly) long long totalBytesDownloaded;
183 
187 @property (nonatomic, assign, readonly) long long totalBytesExpected;
188 
193 @property (nullable, nonatomic, copy, readwrite) void(^progressHandler)(long long totalBytesDownloaded, long long totalBytesExpected);
194 
203 @property (nonatomic, assign, readwrite) BOOL cancelSessionWhenOperationIsCanceled;
204 
211 @property (nonatomic, strong, readonly) NSProgress *progress;
212 
213 #pragma mark -
214 #pragma mark methods
215 
222 -(BOOL)pause ;
223 
228 -(BOOL)isPaused ;
229 
234 -(void)resume ;
235 
236 @end
237 
238 
NSURL * URL
Definition: AGSElevationServiceInfo.h:73
AGSRequestHTTPMethod
Definition: AGSRequestOperation.h:37
@ AGSRequestHTTPMethodPostJSON
Definition: AGSRequestOperation.h:40
@ AGSRequestHTTPMethodPostFormEncodeParameters
Definition: AGSRequestOperation.h:39
@ AGSRequestHTTPMethodGet
Definition: AGSRequestOperation.h:38
Represents an credential to access a secured resource.
Definition: AGSCredential.h:52
Base class for operations. This adds the ability to register a listener to the AGSOperationBase....
Definition: AGSObservableOperation.h:34
Networking related configuration of resources.
Definition: AGSRequestConfiguration.h:42
Base class for operations that perform http requests.
Definition: AGSRequestOperation.h:67
AGSRequestHTTPMethod method
Definition: AGSRequestOperation.h:135
NSURLResponse * response
Definition: AGSRequestOperation.h:166
long long totalBytesExpected
Definition: AGSRequestOperation.h:187
BOOL cancelSessionWhenOperationIsCanceled
Definition: AGSRequestOperation.h:203
id< AGSRemoteResource > remoteResource
Definition: AGSRequestOperation.h:156
NSURL * outputFileURL
Definition: AGSRequestOperation.h:172
void(^ progressHandler)(long long totalBytesDownloaded, long long totalBytesExpected)
AGSRequestConfiguration * requestConfiguration
Definition: AGSRequestOperation.h:151
id< AGSLoadable > loadDependency
Definition: AGSRequestOperation.h:161
long long totalBytesDownloaded
Definition: AGSRequestOperation.h:182
AGSCredential * credential
Definition: AGSRequestOperation.h:145
NSDictionary< NSString *, id > * queryParameters
Definition: AGSRequestOperation.h:129
NSString * sessionID
Definition: AGSRequestOperation.h:177
NSURLRequest * request
Definition: AGSRequestOperation.h:140
NSProgress * progress
Definition: AGSRequestOperation.h:211
A protocol exposed by operations that allow cancellation.
Definition: AGSCancelable.h:38
A protocol adopted by classes that can load data asynchronously.
Definition: AGSLoadable.h:72
A protocol adopted by classes that access remote network resources that have the potential to be secu...
Definition: AGSRemoteResource.h:40