Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/GTLRCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@
"-Wno-unused-parameter",
"-Wno-unknown-pragmas",
"-Widiomatic-parentheses",
"-Wimplicit-atomic-properties",
);
};
name = Debug;
Expand Down Expand Up @@ -1308,6 +1309,7 @@
"-Wno-unused-parameter",
"-Wno-unknown-pragmas",
"-Widiomatic-parentheses",
"-Wimplicit-atomic-properties",
);
};
name = Release;
Expand Down
12 changes: 6 additions & 6 deletions Source/Objects/GTLRBatchQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,40 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Queries included in this batch. Each query should have a unique @c requestID.
*/
@property(nullable) NSArray<GTLRQuery *> *queries;
@property(atomic, nullable) NSArray<GTLRQuery *> *queries;

/**
* Flag indicating if query execution should skip authorization. Defaults to NO.
*/
@property(assign) BOOL shouldSkipAuthorization;
@property(atomic, assign) BOOL shouldSkipAuthorization;

/**
* Any additional HTTP headers for this batch.
*
* These headers override the same keys from the service object's
* @c additionalHTTPHeaders.
*/
@property(copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;
@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;

/**
* Any additional URL query parameters to add to the batch query.
*
* These query parameters override the same keys from the service object's
* @c additionalURLQueryParameters
*/
@property(copy, nullable) NSDictionary<NSString *, NSString *> *additionalURLQueryParameters;
@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalURLQueryParameters;

/**
* The batch request multipart boundary, once determined.
*/
@property(copy, nullable) NSString *boundary;
@property(atomic, copy, nullable) NSString *boundary;

/**
* The brief string to identify this query in @c GTMSessionFetcher http logs.
*
* The default logging name for batch requests includes the API method names.
*/
@property(copy, nullable) NSString *loggingName;
@property(atomic, copy, nullable) NSString *loggingName;

/**
* Constructor for a batch query, for use with @c addQuery:
Expand Down
10 changes: 7 additions & 3 deletions Source/Objects/GTLRBatchQuery.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,18 @@ - (void)addQuery:(GTLRQuery *)query {
}

- (GTLRServiceExecutionParameters *)executionParameters {
if (!_executionParameters) {
_executionParameters = [[GTLRServiceExecutionParameters alloc] init];
@synchronized(self) {
if (!_executionParameters) {
_executionParameters = [[GTLRServiceExecutionParameters alloc] init];
}
}
return _executionParameters;
}

- (void)setExecutionParameters:(GTLRServiceExecutionParameters *)executionParameters {
_executionParameters = executionParameters;
@synchronized(self) {
_executionParameters = executionParameters;
}
}

- (BOOL)hasExecutionParameters {
Expand Down
4 changes: 2 additions & 2 deletions Source/Objects/GTLRBatchResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ NS_ASSUME_NONNULL_BEGIN
*
* Queries which do not return an object when successful have a @c NSNull value.
*/
@property(strong, nullable) NSDictionary<NSString *, __kindof GTLRObject *> *successes;
@property(atomic, strong, nullable) NSDictionary<NSString *, __kindof GTLRObject *> *successes;

/**
* Object results of unsuccessful queries in the batch, keyed by request ID.
*/
@property(strong, nullable) NSDictionary<NSString *, GTLRErrorObject *> *failures;
@property(atomic, strong, nullable) NSDictionary<NSString *, GTLRErrorObject *> *failures;

@end

Expand Down
24 changes: 12 additions & 12 deletions Source/Objects/GTLRErrorObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ NS_ASSUME_NONNULL_BEGIN
/**
* The numeric error code.
*/
@property(strong, nullable) NSNumber *code;
@property(nonatomic, strong, nullable) NSNumber *code;

/**
* An error message string, typically provided by the API server. This is not localized,
* and its reliability depends on the API server.
*/
@property(strong, nullable) NSString *message;
@property(nonatomic, strong, nullable) NSString *message;

//
// V1 properties.
Expand All @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Underlying errors that occurred on the server.
*/
@property(strong, nullable) NSArray<GTLRErrorObjectErrorItem *> *errors;
@property(nonatomic, strong, nullable) NSArray<GTLRErrorObjectErrorItem *> *errors;

//
// V2 properties
Expand All @@ -76,18 +76,18 @@ NS_ASSUME_NONNULL_BEGIN
/**
* A status error string, defined by the API server, such as "NOT_FOUND".
*/
@property(strong, nullable) NSString *status;
@property(nonatomic, strong, nullable) NSString *status;

/**
* Additional diagnostic error details provided by the API server.
*/
@property(strong, nullable) NSArray<GTLRErrorObjectDetail *> *details;
@property(nonatomic, strong, nullable) NSArray<GTLRErrorObjectDetail *> *details;

/**
* An NSError, either underlying the error object or manufactured from the error object's
* properties.
*/
@property(readonly) NSError *foundationError;
@property(nonatomic, readonly) NSError *foundationError;

@end

Expand All @@ -97,10 +97,10 @@ NS_ASSUME_NONNULL_BEGIN
* Client applications should not rely on the property values of these items.
*/
@interface GTLRErrorObjectErrorItem : GTLRObject
@property(strong, nullable) NSString *domain;
@property(strong, nullable) NSString *reason;
@property(strong, nullable) NSString *message;
@property(strong, nullable) NSString *location;
@property(nonatomic, strong, nullable) NSString *domain;
@property(nonatomic, strong, nullable) NSString *reason;
@property(nonatomic, strong, nullable) NSString *message;
@property(nonatomic, strong, nullable) NSString *location;
@end

/**
Expand All @@ -109,8 +109,8 @@ NS_ASSUME_NONNULL_BEGIN
* Client applications should not rely on the property values of these items.
*/
@interface GTLRErrorObjectDetail : GTLRObject
@property(strong, nullable) NSString *type;
@property(strong, nullable) NSString *detail;
@property(nonatomic, strong, nullable) NSString *type;
@property(nonatomic, strong, nullable) NSString *detail;
@end

NS_ASSUME_NONNULL_END
4 changes: 2 additions & 2 deletions Source/Objects/GTLRObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ NS_ASSUME_NONNULL_BEGIN
/**
* The downloaded media data.
*/
@property(strong) NSData *data;
@property(atomic, strong) NSData *data;

/**
* The MIME type of the downloaded media data.
*/
@property(copy) NSString *contentType;
@property(atomic, copy) NSString *contentType;

@end

Expand Down
6 changes: 3 additions & 3 deletions Source/Objects/GTLRObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ - (NSUInteger)hash {
}

- (id)copyWithZone:(NSZone *)zone {
GTLRObject* newObject = [[[self class] allocWithZone:zone] init];
newObject->_json = DeepMutableCopyOfJSONDictionary(_json);
newObject->_objectClassResolver = self->_objectClassResolver;
GTLRObject *newObject = [[[self class] allocWithZone:zone] init];
newObject.JSON = DeepMutableCopyOfJSONDictionary(self.JSON);
newObject.objectClassResolver = self.objectClassResolver;

// What we're not copying:
// userProperties
Expand Down
40 changes: 20 additions & 20 deletions Source/Objects/GTLRQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
* Service ticket values may be set in the execution parameters for an individual query
* prior to executing the query.
*/
@property(strong, null_resettable) GTLRServiceExecutionParameters *executionParameters;
@property(atomic, strong, null_resettable) GTLRServiceExecutionParameters *executionParameters;

- (BOOL)isBatchQuery;
- (BOOL)hasExecutionParameters;
Expand All @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN

@protocol GTLRQueryCollectionProtocol
@optional
@property(strong) NSString *pageToken;
@property(nonatomic, strong) NSString *pageToken;
@end

/**
Expand Down Expand Up @@ -85,69 +85,69 @@ typedef void (^GTLRQueryCompletionBlock)(GTLRServiceTicket *callbackTicket,
* The object to be uploaded with the query. The JSON of this object becomes
* the body for PUT and POST requests.
*/
@property(strong, nullable) GTLRObject *bodyObject;
@property(atomic, strong, nullable) GTLRObject *bodyObject;

/**
* Each query must have a request ID string. The client app may replace the
* default assigned request ID with a custom string, provided that if
* used in a batch query, all request IDs in the batch must be unique.
*/
@property(copy) NSString *requestID;
@property(atomic, copy) NSString *requestID;

/**
* For queries which support file upload, the MIME type and file URL
* or data must be provided.
*/
@property(copy, nullable) GTLRUploadParameters *uploadParameters;
@property(atomic, copy, nullable) GTLRUploadParameters *uploadParameters;

/**
* Any additional URL query parameters for this query.
*
* These query parameters override the same keys from the service object's
* additionalURLQueryParameters
*/
@property(copy, nullable) NSDictionary<NSString *, NSString *> *additionalURLQueryParameters;
@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalURLQueryParameters;

/**
* Any additional HTTP headers for this query.
*
* These headers override the same keys from the service object's additionalHTTPHeaders
*/
@property(copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;
@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;

/**
* If set, when the query is executed, an @c "alt" query parameter is added
* with this value and the raw result of the query is returned in a
* GTLRDataObject. This is useful when the server documents result datatypes
* other than JSON ("csv", for example).
*/
@property(copy) NSString *downloadAsDataObjectType;
@property(atomic, copy) NSString *downloadAsDataObjectType;

/**
* If set, and the query also has a non-empty @c downloadAsDataObjectType, the
* URL to download from will be modified to include "download/". This extra path
* component avoids the need for a server redirect to the download URL.
*/
@property(assign) BOOL useMediaDownloadService;
@property(atomic, assign) BOOL useMediaDownloadService;

/**
* Clients may set this to YES to disallow authorization. Defaults to NO.
*/
@property(assign) BOOL shouldSkipAuthorization;
@property(atomic, assign) BOOL shouldSkipAuthorization;

/**
* An optional callback block to be called immediately before the executeQuery: completion handler.
*
* The completionBlock property is particularly useful for queries executed in a batch.
*/
@property(copy, nullable) GTLRQueryCompletionBlock completionBlock;
@property(atomic, copy, nullable) GTLRQueryCompletionBlock completionBlock;

/**
* The brief string to identify this query in GTMSessionFetcher http logs.
*
* A default logging name is set by the code generator, but may be overridden by the client app.
*/
@property(copy, nullable) NSString *loggingName;
@property(atomic, copy, nullable) NSString *loggingName;

#pragma mark Internal
/////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -159,12 +159,12 @@ typedef void (^GTLRQueryCompletionBlock)(GTLRServiceTicket *callbackTicket,
/**
* The URITemplate path segment. This is initialized in by the service generator.
*/
@property(readonly) NSString *pathURITemplate;
@property(atomic, readonly) NSString *pathURITemplate;

/**
* The HTTP method to use for this query. This is initialized in by the service generator.
*/
@property(readonly, nullable) NSString *httpMethod;
@property(atomic, readonly, nullable) NSString *httpMethod;

/**
* The parameters names that are in the URI Template.
Expand All @@ -173,41 +173,41 @@ typedef void (^GTLRQueryCompletionBlock)(GTLRServiceTicket *callbackTicket,
* The service generator collects these via the discovery info instead of having to parse the
* template to figure out what is part of the path.
*/
@property(readonly, nullable) NSArray<NSString *> *pathParameterNames;
@property(atomic, readonly, nullable) NSArray<NSString *> *pathParameterNames;

/**
* The JSON dictionary of all the parameters set on this query.
*
* The JSON values are set by setting the query's properties.
*/
@property(strong, nullable) NSMutableDictionary<NSString *, id> *JSON;
@property(nonatomic, strong, nullable) NSMutableDictionary<NSString *, id> *JSON;

/**
* A custom URI template for resumable uploads. This is initialized by the service generator
* if needed.
*/
@property(copy, nullable) NSString *resumableUploadPathURITemplateOverride;
@property(atomic, copy, nullable) NSString *resumableUploadPathURITemplateOverride;

/**
* A custom URI template for simple and multipart media uploads. This is initialized
* by the service generator.
*/
@property(copy, nullable) NSString *simpleUploadPathURITemplateOverride;
@property(atomic, copy, nullable) NSString *simpleUploadPathURITemplateOverride;

/**
* The GTLRObject subclass expected for results. This is initialized by the service generator.
*
* This is needed if the object returned by the server lacks a known "kind" string.
*/
@property(assign, nullable) Class expectedObjectClass;
@property(atomic, assign, nullable) Class expectedObjectClass;

/**
* Set when the query has been invalidated, meaning it was slated for execution so it's been copied
* and its callbacks were released, or it's a copy that has finished executing.
*
* Once a query has been invalidated, it cannot be executed, added to a batch, or copied.
*/
@property(assign, getter=isQueryInvalid) BOOL queryInvalid;
@property(atomic, assign, getter=isQueryInvalid) BOOL queryInvalid;

/**
* Internal query init method.
Expand Down
Loading