From 2b793622fc004635eb323062c42bf01d3a4cb08b Mon Sep 17 00:00:00 2001 From: Sergio Azua Date: Thu, 22 Jun 2017 13:50:26 -0500 Subject: [PATCH] Add syndicationSource to Comments, Questions, and Answers --- BVSDK.podspec | 2 +- BVSDK/Info.plist | 4 ++-- .../Display/Model/GenericConversationsResult/BVAnswer.h | 2 ++ .../Display/Model/GenericConversationsResult/BVAnswer.m | 4 ++++ .../Display/Model/GenericConversationsResult/BVComment.h | 2 ++ .../Display/Model/GenericConversationsResult/BVComment.m | 4 ++++ .../Display/Model/GenericConversationsResult/BVQuestion.h | 2 ++ .../Display/Model/GenericConversationsResult/BVQuestion.m | 4 ++++ .../Display/Model/GenericConversationsResult/BVReview.h | 2 +- .../Display/Model/GenericConversationsResult/BVReview.m | 2 +- 10 files changed, 23 insertions(+), 5 deletions(-) diff --git a/BVSDK.podspec b/BVSDK.podspec index 187b86d5..3e2bbd72 100644 --- a/BVSDK.podspec +++ b/BVSDK.podspec @@ -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' } diff --git a/BVSDK/Info.plist b/BVSDK/Info.plist index 83f8a6a0..719a4cbb 100644 --- a/BVSDK/Info.plist +++ b/BVSDK/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.7.2 + 6.7.3 CFBundleVersion - 6.7.2 + 6.7.3 LSApplicationCategoryType NSPrincipalClass diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.h b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.h index e6f5cfc4..fdfeeda3 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.h +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.h @@ -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. @@ -46,5 +47,6 @@ @property NSDate* _Nullable lastModificationTime; @property NSDate* _Nullable lastModeratedTime; @property (readonly) BOOL isSyndicated; +@property (nonatomic, strong, readonly, nullable) BVSyndicationSource* syndicationSource; @end diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.m b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.m index 8fd4866f..93c9bedf 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.m +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVAnswer.m @@ -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]; + } } } diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.h b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.h index ad00258c..bfad0ada 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.h +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.h @@ -9,6 +9,7 @@ #import "BVGenericConversationsResult.h" #import "BVBadge.h" +#import "BVSyndicationSource.h" @interface BVComment : NSObject @@ -35,6 +36,7 @@ @property (readonly) NSArray* _Nonnull badges; @property (readonly) BOOL isSyndicated; +@property (nonatomic, strong, readonly, nullable) BVSyndicationSource* syndicationSource; @property (nonatomic, strong, readonly) BVConversationsInclude * _Nullable includes; diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.m b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.m index 06fd28f0..a9710d3a 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.m +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVComment.m @@ -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"]]; diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.h b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.h index 50b36e6e..8ef02e94 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.h +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.h @@ -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?" @@ -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 diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.m b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.m index 58cb28be..c71359a4 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.m +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVQuestion.m @@ -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"]) diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.h b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.h index 5eea7d13..e1a38e71 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.h +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.h @@ -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 * _Nonnull comments; @end diff --git a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.m b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.m index 18dc4878..cb6ad40a 100644 --- a/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.m +++ b/Pod/BVConversations/Display/Model/GenericConversationsResult/BVReview.m @@ -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]; } }