Skip to content

Commit

Permalink
Add syndicationSource to Comments, Questions, and Answers
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioazua committed Jun 22, 2017
1 parent 22e8b70 commit 2b79362
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BVSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "BVSDK"
s.version = '6.7.2'
s.version = '6.7.3'
s.homepage = 'https://developer.bazaarvoice.com'
s.license = { :type => 'Commercial', :text => 'See https://developer.bazaarvoice.com/API_Terms_of_Use' }
s.author = { 'Bazaarvoice' => 'support@bazaarvoice.com' }
Expand Down
4 changes: 2 additions & 2 deletions BVSDK/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.7.2</string>
<string>6.7.3</string>
<key>CFBundleVersion</key>
<string>6.7.2</string>
<string>6.7.3</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "BVGenericConversationsResult.h"
#import "BVPhoto.h"
#import "BVVideo.h"
#import "BVSyndicationSource.h"

/*
The answer to a question asked by a consumer.
Expand Down Expand Up @@ -46,5 +47,6 @@
@property NSDate* _Nullable lastModificationTime;
@property NSDate* _Nullable lastModeratedTime;
@property (readonly) BOOL isSyndicated;
@property (nonatomic, strong, readonly, nullable) BVSyndicationSource* syndicationSource;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ -(id _Nonnull)initWithApiResponse:(NSDictionary* _Nonnull)apiResponse includes:(
NSNumber* isSyndicated = apiResponse[@"IsSyndicated"];
if(![isSyndicated isKindOfClass:[NSNull class]]) {
_isSyndicated = [isSyndicated boolValue];

if (self.isSyndicated) {
_syndicationSource = [[BVSyndicationSource alloc] initWithApiResponse:apiResponse];
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#import "BVGenericConversationsResult.h"
#import "BVBadge.h"
#import "BVSyndicationSource.h"

@interface BVComment : NSObject<BVGenericConversationsResult>

Expand All @@ -35,6 +36,7 @@
@property (readonly) NSArray<BVBadge*>* _Nonnull badges;

@property (readonly) BOOL isSyndicated;
@property (nonatomic, strong, readonly, nullable) BVSyndicationSource* syndicationSource;

@property (nonatomic, strong, readonly) BVConversationsInclude * _Nullable includes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ -(id)initWithApiResponse:(NSDictionary *)apiResponse includes:(BVConversationsIn
NSNumber* isSyndicated = apiResponse[@"IsSyndicated"];
if(![isSyndicated isKindOfClass:[NSNull class]]) {
_isSyndicated = [isSyndicated boolValue];

if (self.isSyndicated) {
_syndicationSource = [[BVSyndicationSource alloc] initWithApiResponse:apiResponse];
}
}

_badges = [BVModelUtil parseBadges:apiResponse[@"Badges"]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "BVVideo.h"
#import "BVContextDataValue.h"
#import "BVBadge.h"
#import "BVSyndicationSource.h"

/*
A consumer generated question about a product. For example: "Is this toaster heavy?" or "How many HDMI ports does this TV have?"
Expand Down Expand Up @@ -54,5 +55,6 @@
@property (nonatomic, copy) NSNumber* _Nullable totalNegativeFeedbackCount;
@property bool isFeatured;
@property (readonly) BOOL isSyndicated;
@property (nonatomic, strong, readonly, nullable) BVSyndicationSource* syndicationSource;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ -(id)initWithApiResponse:(NSDictionary *)apiResponse includes:(BVConversationsIn
NSNumber* isSyndicated = apiResponse[@"IsSyndicated"];
if(![isSyndicated isKindOfClass:[NSNull class]]) {
_isSyndicated = [isSyndicated boolValue];

if (self.isSyndicated) {
_syndicationSource = [[BVSyndicationSource alloc] initWithApiResponse:apiResponse];
}
}

SET_IF_NOT_NULL(self.productRecommendationIds, apiResponse[@"ProductRecommendationIds"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
@property NSDate* _Nullable lastModificationTime;
@property NSDate* _Nullable submissionTime;
@property NSDate* _Nullable lastModeratedTime;
@property BVSyndicationSource* _Nullable syndicationSource;
@property (nonatomic, strong, readonly, nullable) BVSyndicationSource* syndicationSource;
@property (readonly) NSArray<BVComment *> * _Nonnull comments;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ -(id)initWithApiResponse:(NSDictionary *)apiResponse includes:(BVConversationsIn
self.isSyndicated = [isSyndicated boolValue];

if (self.isSyndicated) {
self.syndicationSource = [[BVSyndicationSource alloc] initWithApiResponse:apiResponse];
_syndicationSource = [[BVSyndicationSource alloc] initWithApiResponse:apiResponse];
}

}
Expand Down

0 comments on commit 2b79362

Please sign in to comment.