-
Notifications
You must be signed in to change notification settings - Fork 113
Requesting metadata information when getting file data #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Verified that @minahattoriBOX has signed the CLA. Thanks for the pull request! |
| * | ||
| * @param folderID Folder ID. | ||
| * @param templateKey The template key for specific metadata template | ||
| * @param scope The scope that then metadata is in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?? 'The scope that then metadata is in'
|
|
||
| - (instancetype) initWithFolderID:(NSString *)folderID templateKey: (NSString *)templateKey scope: (NSString *)scope | ||
| { | ||
| if (self = [super init]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, space 'if (self = [super init]){'
|
|
||
| //Metadata information parameters | ||
| @property (nonatomic, readwrite, strong) NSString *templateKey; | ||
| @property (nonatomic, readwrite, strong) NSString *scope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be copy, rather than strong. This applies basically to all NSString, NSArray, NSData, etc.
|
|
||
| - (instancetype) initWithFolderID:(NSString *)folderID templateKey: (NSString *)templateKey scope: (NSString *)scope inRange:(NSRange)range | ||
| { | ||
| if (self = [super init]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit; space
| */ | ||
| - (BOXFolderItemsRequest *)folderItemsRequestWithID:(NSString *)folderID | ||
| templateKey:(NSString *)templateKey | ||
| scope: (NSString *)scope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets rename this parameters so it's clear they are associated with metadata:
templateKey -> metadataTemplateKey
scope -> metadataScope
5b23a56 to
1fdd16f
Compare
| { | ||
| if (self = [super init]){ | ||
| _folderID = folderID; | ||
| _limit = range.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: traditionally, pagination params (limit and offset) go after the item attribute params.
| BOXFolderPaginatedItemsRequest *request = [[BOXFolderPaginatedItemsRequest alloc] initWithFolderID:@"123" inRange:NSMakeRange(0,5)]; | ||
| request.requestAllItemFields = YES; | ||
|
|
||
| NSString *expectedFieldString = @"type,id,sequence_id,etag,name,description,size,path_collection,created_at,modified_at,trashed_at,purged_at,content_created_at,content_modified_at,created_by,modified_by,owned_by,shared_link,parent,item_status,permissions,lock,extension,is_package,allowed_shared_link_access_levels,collections,collection_memberships,folder_upload_email,sync_state,has_collaborations,is_externally_owned,can_non_owners_invite,allowed_invitee_roles,sha1,version_number,comment_count,url"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make this string a constant, that we can re-use above.
1fdd16f to
138c9bc
Compare
| * | ||
| * @param folderID Folder ID. | ||
| * @param metadataTemplateKey The template key for specific metadata template | ||
| * @param metadataScope The scope that then metadata is in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. Consistent comment with 204.
138c9bc to
5aadc01
Compare
5aadc01 to
7f65284
Compare
jlawton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the added tests!
| * | ||
| * @return A request that can be customized and then executed. | ||
| */ | ||
| - (BOXFolderPaginatedItemsRequest *)folderPaginatedItemsRequestWithID:(NSString *)folderID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Align : on these lines.
| */ | ||
| - (BOXFolderItemsRequest *)folderItemsRequestWithID:(NSString *)folderID | ||
| metadataTemplateKey:(NSString *)metadataTemplateKey | ||
| metadataScope: (BOXMetadataScope)metadataScope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: No space after : here.
| } | ||
|
|
||
| - (BOXFolderItemsRequest *)folderItemsRequestWithID:(NSString *)folderID | ||
| metadataTemplateKey: (NSString *)metadataTemplateKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Align : and remove spaces.
| } | ||
|
|
||
| - (BOXFolderPaginatedItemsRequest *)folderPaginatedItemsRequestWithID:(NSString *)folderID | ||
| metadataTemplateKey: (NSString *)metadataTemplateKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Align : and remove spaces.
|
|
||
| @interface BOXFolderItemsRequest (Metadata) | ||
|
|
||
| @property (nonatomic, readwrite, strong) NSString *folderID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy
|
|
||
| - (instancetype)initWithFolderID:(NSString *)folderID metadataTemplateKey: (NSString *)metadataTemplateKey metadataScope: (BOXMetadataScope)metadataScope | ||
| { | ||
| if (self = [super init]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Space before {
| BOXFolderPaginatedItemsRequest *paginatedRequest = nil; | ||
|
|
||
| if (self.metadataTemplateKey != nil && self.metadataScope != nil) { | ||
| paginatedRequest = [[BOXFolderPaginatedItemsRequest alloc] initWithFolderID:self.folderID metadataTemplateKey: self.metadataTemplateKey metadataScope: self.metadataScope inRange:range]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Not spaces after :
| @property (nonatomic, readwrite, copy) BOXMetadataScope metadataScope; | ||
|
|
||
| - (instancetype)initWithFolderID:(NSString *)folderID inRange:(NSRange)range; | ||
| - (instancetype)initWithFolderID:(NSString *)folderID metadataTemplateKey: (NSString *)metadataTemplateKey metadataScope: (BOXMetadataScope)metadataScope inRange:(NSRange)range; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: No spaces after :
| return self; | ||
| } | ||
|
|
||
| - (instancetype) initWithFolderID:(NSString *)folderID metadataTemplateKey: (NSString *)metadataTemplateKey metadataScope: (BOXMetadataScope)metadataScope inRange:(NSRange)range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: No spaces after : or (instancetype)
|
|
||
| - (instancetype) initWithFolderID:(NSString *)folderID metadataTemplateKey: (NSString *)metadataTemplateKey metadataScope: (BOXMetadataScope)metadataScope inRange:(NSRange)range | ||
| { | ||
| if (self = [super init]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Space before {
7f65284 to
0eb4b49
Compare
0eb4b49 to
a342226
Compare
No description provided.