ZenfolioAPI 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ZenfolioAPI/session.rb +20 -0
- data/lib/ZenfolioAPI/version.rb +1 -1
- data/spec/ZenfolioAPI_spec.rb +1 -1
- metadata +1 -1
data/lib/ZenfolioAPI/session.rb
CHANGED
@@ -144,5 +144,25 @@ module ZenfolioAPI
|
|
144
144
|
|
145
145
|
elements
|
146
146
|
end
|
147
|
+
|
148
|
+
# The LoadPhotoSet method obtains a snapshot of the specified photoset (gallery or collection).
|
149
|
+
#
|
150
|
+
# @author David Slone
|
151
|
+
# @param [Integer] gallery_id 64-bit identifier of the photoset/gallery to load
|
152
|
+
# @param [String] info_level Specifies which PhotoSet snapshot fields to return. This parameter is new in API version 1.4.
|
153
|
+
# @param [String] include_photos Specifies whether to return photoset photos. This parameter is new in API version 1.4.
|
154
|
+
def load_photo_set gallery_id, info_level = "Full", include_photos = "false"
|
155
|
+
@response = api_request 'LoadPhotoSet', [gallery_id, info_level, include_photos]
|
156
|
+
raise ZenfolioAPI::ZenfolioAPISessionError, @response['error']['message'] if @response['result'].nil? && @response['error'].length > 0
|
157
|
+
|
158
|
+
gallery = ZenfolioAPI::Model::Gallery.new(:id => value['Id'], :type => value['$type'], :caption => value['Caption'],
|
159
|
+
:created_on => value['CreatedOn']['Value'], :modified_on => value['ModifiedOn']['Value'], :photo_count => value['PhotoCount'],
|
160
|
+
:image_count => value['ImageCount'], :video_count => value['VideoCount'], :photo_bytes => value['PhotoBytes'], :views => value['Views'],
|
161
|
+
:featured_index => value['FeaturedIndex'], :is_random_title_photo => value['IsRandomTitlePhoto'], :upload_url => value['UploadUrl'],
|
162
|
+
:video_upload_url => value['VideoUploadUrl'], :page_url => value['PageUrl'], :mailbox_id => value['MailboxId'], :text_cn => value['TextCn'],
|
163
|
+
:photo_list_cn => value['PhotoListCn'], :group_index => value['GroupIndex'], :title => value['Title'], :owner => value['Owner'])
|
164
|
+
|
165
|
+
gallery
|
166
|
+
end
|
147
167
|
end
|
148
168
|
end
|
data/lib/ZenfolioAPI/version.rb
CHANGED
data/spec/ZenfolioAPI_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe ZenfolioAPI do
|
4
|
-
session = ZenfolioAPI::Session.new('
|
4
|
+
session = ZenfolioAPI::Session.new(ENV['ZENFOLIO_USERNAME'],ENV['ZENFOLIO_PASSWORD'])
|
5
5
|
|
6
6
|
it "Should connect to API server" do
|
7
7
|
session.should_not be_nil
|