Skip to content

Conversation

@minahattoriBOX
Copy link
Contributor

No description provided.

@boxcla
Copy link

boxcla commented Jul 23, 2018

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
Copy link
Contributor

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]){
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is scope?

Copy link
Contributor

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]){
Copy link
Contributor

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;

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

@minahattoriBOX minahattoriBOX changed the title Requesting metadata information when getting file data IOS-16067 Requesting metadata information when getting file data Jul 23, 2018
@minahattoriBOX minahattoriBOX changed the title IOS-16067 Requesting metadata information when getting file data IOS-16067: Requesting metadata information when getting file data Jul 23, 2018
@minahattoriBOX minahattoriBOX changed the title IOS-16067: Requesting metadata information when getting file data Requesting metadata information when getting file data Jul 23, 2018
{
if (self = [super init]){
_folderID = folderID;
_limit = range.length;

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";

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.

*
* @param folderID Folder ID.
* @param metadataTemplateKey The template key for specific metadata template
* @param metadataScope The scope that then metadata is in

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.

Copy link
Contributor

@jlawton jlawton left a 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
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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;
Copy link
Contributor

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]){
Copy link
Contributor

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];
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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]){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Space before {

@minahattoriBOX minahattoriBOX merged commit d48a4e9 into master Jul 24, 2018
@minahattoriBOX minahattoriBOX deleted the IOS-16067 branch July 24, 2018 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants