# Syncs your Contentstack data with your app and ensures that the data is always up-to-date by providing delta updates
#
# Stack.sync({'init': true}) // For initializing sync
#
# Stack.sync({'init': true, 'locale': 'en-us'}) //For initializing sync with entries of a specific locale
#
# Stack.sync({'init': true, 'start_date': '2018-10-22'}) //For initializing sync with entries published after a specific date
#
# Stack.sync({'init': true, 'content_type_uid': 'session'}) //For initializing sync with entries of a specific content type
#
# Stack.sync({'init': true, 'type': 'entry_published'}) // Use the type parameter to get a specific type of content.Supports 'asset_published', 'entry_published', 'asset_unpublished', 'entry_unpublished', 'asset_deleted', 'entry_deleted', 'content_type_deleted'.
#
# Stack.sync({'pagination_token': '<pagination>'}) // For fetching the next batch of entries using pagination token
#
# Stack.sync({'sync_token': '<sync>'}) // For performing subsequent sync after initial sync
#
# @param params [Hash] params is an object that supports ‘locale’, ‘start_date’, ‘content_type_uid’, and ‘type’ queries.
defsync(params)
sync_result=API.get_sync_items(params)
SyncResult.new(sync_result)
end
private
defget_host_by_region(region,options)
custom_host=options[:host]
Contentstack::Endpoint.get_contentstack_endpoint(
region.present? ? region : Contentstack::Region::US,