Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log control options #3

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions KalturaClient/Classes/Core/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

super.init()

clientTag = "swift:18-07-31"
apiVersion = "5.0.1.14736"
clientTag = "swift:18-11-22"
apiVersion = "5.0.1.15905"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ extension Dictionary where Key == String {


result.append(prefix)
let sortedKeys = self.keys.sorted()
let sortedKeys = self.keys.sorted {$0.localizedStandardCompare($1) == .orderedAscending}
for key in sortedKeys {

let jsonObject = self[key]!
Expand Down
8 changes: 8 additions & 0 deletions KalturaClient/Classes/Logs/KalturaClientLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ public class KalturaLogger {
public func error(_ message: Any, file: String = #file, line: Int = #line, column: Int = #column, function: String = #function){
logger.log(.error, message: message, file: file, line: line, column: column, function: function)
}

public func isLoggerEnabled(isEnabled:Bool){
logger.enabled = isEnabled
}

public func setloggerMinLevel(minLevel: LogLevel){
logger.minLevel = minLevel
}

}

Expand Down
60 changes: 60 additions & 0 deletions KalturaClient/Classes/Model/Objects/ProgramAsset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@ open class ProgramAsset: Asset {
return self.append("linearAssetId")
}
}

public var enableCdvr: BaseTokenizedObject {
get {
return self.append("enableCdvr")
}
}

public var enableCatchUp: BaseTokenizedObject {
get {
return self.append("enableCatchUp")
}
}

public var enableStartOver: BaseTokenizedObject {
get {
return self.append("enableStartOver")
}
}

public var enableTrickPlay: BaseTokenizedObject {
get {
return self.append("enableTrickPlay")
}
}
}

/** EPG channel identifier */
Expand All @@ -79,6 +103,14 @@ open class ProgramAsset: Asset {
public var crid: String? = nil
/** Id of linear media asset */
public var linearAssetId: Int64? = nil
/** Is CDVR enabled for this asset */
public var enableCdvr: Bool? = nil
/** Is catch-up enabled for this asset */
public var enableCatchUp: Bool? = nil
/** Is start over enabled for this asset */
public var enableStartOver: Bool? = nil
/** Is trick-play enabled for this asset */
public var enableTrickPlay: Bool? = nil


public func setMultiRequestToken(epgChannelId: String) {
Expand All @@ -101,6 +133,22 @@ open class ProgramAsset: Asset {
self.dict["linearAssetId"] = linearAssetId
}

public func setMultiRequestToken(enableCdvr: String) {
self.dict["enableCdvr"] = enableCdvr
}

public func setMultiRequestToken(enableCatchUp: String) {
self.dict["enableCatchUp"] = enableCatchUp
}

public func setMultiRequestToken(enableStartOver: String) {
self.dict["enableStartOver"] = enableStartOver
}

public func setMultiRequestToken(enableTrickPlay: String) {
self.dict["enableTrickPlay"] = enableTrickPlay
}

internal override func populate(_ dict: [String: Any]) throws {
try super.populate(dict);
// set members values:
Expand All @@ -119,6 +167,18 @@ open class ProgramAsset: Asset {
if dict["linearAssetId"] != nil {
linearAssetId = Int64("\(dict["linearAssetId"]!)")
}
if dict["enableCdvr"] != nil {
enableCdvr = dict["enableCdvr"] as? Bool
}
if dict["enableCatchUp"] != nil {
enableCatchUp = dict["enableCatchUp"] as? Bool
}
if dict["enableStartOver"] != nil {
enableStartOver = dict["enableStartOver"] as? Bool
}
if dict["enableTrickPlay"] != nil {
enableTrickPlay = dict["enableTrickPlay"] as? Bool
}

}

Expand Down
40 changes: 0 additions & 40 deletions KalturaClient/Classes/Model/Objects/RelatedFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ open class RelatedFilter: BaseSearchAssetFilter {

public class RelatedFilterTokenizer: BaseSearchAssetFilter.BaseSearchAssetFilterTokenizer {

public var kSql: BaseTokenizedObject {
get {
return self.append("kSql")
}
}

public var idEqual: BaseTokenizedObject {
get {
return self.append("idEqual")
Expand All @@ -62,30 +56,6 @@ open class RelatedFilter: BaseSearchAssetFilter {
}
}

/** Search assets using dynamic criteria. Provided collection of nested expressions
with key, comparison operators, value, and logical conjunction.
Possible keys: any Tag or Meta defined in the system and the following reserved
keys: start_date, end_date. epg_id, media_id - for specific asset
IDs. geo_block - only valid value is "true": When
enabled, only assets that are not restriced to the user by geo-block rules will
return. parental_rules - only valid value is
"true": When enabled, only assets that the user
doesn't need to provide PIN code will return.
user_interests - only valid value is "true". When enabled,
only assets that the user defined as his interests (by tags and metas) will
return. epg_channel_id – the channel identifier of the EPG
program. *****Deprecated, please use linear_media_id instead*****
linear_media_id – the linear media identifier of the EPG program.
entitled_assets - valid values: "free",
"entitled", "both". free - gets only free to
watch assets. entitled - only those that the user is implicitly entitled to
watch. Comparison operators: for numerical fields =, >,
>=, <, <=, : (in). For alpha-numerical fields
=, != (not), ~ (like), !~, ^ (any word starts with), ^= (phrase starts with), +
(exists), !+ (not exists). Logical conjunction: and, or.
Search values are limited to 20 characters each. (maximum length
of entire filter is 2048 characters) */
public var kSql: String? = nil
/** the ID of the asset for which to return related assets */
public var idEqual: Int? = nil
/** (Deprecated - use KalturaBaseSearchAssetFilter.kSql) Comma
Expand All @@ -97,10 +67,6 @@ open class RelatedFilter: BaseSearchAssetFilter {
public var excludeWatched: Bool? = nil


public func setMultiRequestToken(kSql: String) {
self.dict["kSql"] = kSql
}

public func setMultiRequestToken(idEqual: String) {
self.dict["idEqual"] = idEqual
}
Expand All @@ -116,9 +82,6 @@ open class RelatedFilter: BaseSearchAssetFilter {
internal override func populate(_ dict: [String: Any]) throws {
try super.populate(dict);
// set members values:
if dict["kSql"] != nil {
kSql = dict["kSql"] as? String
}
if dict["idEqual"] != nil {
idEqual = dict["idEqual"] as? Int
}
Expand All @@ -133,9 +96,6 @@ open class RelatedFilter: BaseSearchAssetFilter {

internal override func toDictionary() -> [String: Any] {
var dict: [String: Any] = super.toDictionary()
if(kSql != nil) {
dict["kSql"] = kSql!
}
if(idEqual != nil) {
dict["idEqual"] = idEqual!
}
Expand Down
42 changes: 0 additions & 42 deletions KalturaClient/Classes/Model/Objects/SearchAssetFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,45 +37,13 @@ open class SearchAssetFilter: BaseSearchAssetFilter {

public class SearchAssetFilterTokenizer: BaseSearchAssetFilter.BaseSearchAssetFilterTokenizer {

public var kSql: BaseTokenizedObject {
get {
return self.append("kSql")
}
}

public var typeIn: BaseTokenizedObject {
get {
return self.append("typeIn")
}
}
}

/** Search assets using dynamic criteria. Provided collection of nested expressions
with key, comparison operators, value, and logical conjunction.
Possible keys: any Tag or Meta defined in the system and the following reserved
keys: start_date, end_date. epg_id, media_id - for specific asset
IDs. geo_block - only valid value is "true": When
enabled, only assets that are not restriced to the user by geo-block rules will
return. parental_rules - only valid value is
"true": When enabled, only assets that the user
doesn't need to provide PIN code will return.
user_interests - only valid value is "true". When enabled,
only assets that the user defined as his interests (by tags and metas) will
return. epg_channel_id – the channel identifier of the EPG
program. *****Deprecated, please use linear_media_id instead*****
linear_media_id – the linear media identifier of the EPG program.
entitled_assets - valid values: "free",
"entitled", "both". free - gets only free to
watch assets. entitled - only those that the user is implicitly entitled to
watch. asset_type - valid values: "media",
"epg", "recording" or any number that
represents media type in group. Comparison operators: for numerical
fields =, >, >=, <, <=, : (in). For
alpha-numerical fields =, != (not), ~ (like), !~, ^ (any word starts with), ^=
(phrase starts with), + (exists), !+ (not exists). Logical
conjunction: and, or. Search values are limited to 20 characters
each. (maximum length of entire filter is 2048 characters) */
public var kSql: String? = nil
/** (Deprecated - use KalturaBaseSearchAssetFilter.kSql) Comma
separated list of asset types to search within. Possible values: 0
– EPG linear programs entries; 1 - Recordings; Any media type ID (according to
Expand All @@ -84,20 +52,13 @@ open class SearchAssetFilter: BaseSearchAssetFilter {
public var typeIn: String? = nil


public func setMultiRequestToken(kSql: String) {
self.dict["kSql"] = kSql
}

public func setMultiRequestToken(typeIn: String) {
self.dict["typeIn"] = typeIn
}

internal override func populate(_ dict: [String: Any]) throws {
try super.populate(dict);
// set members values:
if dict["kSql"] != nil {
kSql = dict["kSql"] as? String
}
if dict["typeIn"] != nil {
typeIn = dict["typeIn"] as? String
}
Expand All @@ -106,9 +67,6 @@ open class SearchAssetFilter: BaseSearchAssetFilter {

internal override func toDictionary() -> [String: Any] {
var dict: [String: Any] = super.toDictionary()
if(kSql != nil) {
dict["kSql"] = kSql!
}
if(typeIn != nil) {
dict["typeIn"] = typeIn!
}
Expand Down
8 changes: 6 additions & 2 deletions KalturaClient/Classes/Services/AssetService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public final class AssetService{
}
}

/** Add a new asset */
/** Add a new asset. For metas of type bool-> use
kalturaBoolValue, type number-> KalturaDoubleValue, type date ->
KalturaLongValue, type string -> KalturaStringValue */
public static func add(asset: Asset) -> RequestBuilder<Asset, Asset.AssetTokenizer, AddTokenizer> {
let request: RequestBuilder<Asset, Asset.AssetTokenizer, AddTokenizer> = RequestBuilder<Asset, Asset.AssetTokenizer, AddTokenizer>(service: "asset", action: "add")
.setParam(key: "asset", value: asset)
Expand Down Expand Up @@ -249,7 +251,9 @@ public final class AssetService{
}
}

/** update an existing asset */
/** update an existing asset. For metas of type bool-&amp;gt; use
kalturaBoolValue, type number-&amp;gt; KalturaDoubleValue, type date -&amp;gt;
KalturaLongValue, type string -&amp;gt; KalturaStringValue */
public static func update(id: Int64, asset: Asset) -> RequestBuilder<Asset, Asset.AssetTokenizer, UpdateTokenizer> {
let request: RequestBuilder<Asset, Asset.AssetTokenizer, UpdateTokenizer> = RequestBuilder<Asset, Asset.AssetTokenizer, UpdateTokenizer>(service: "asset", action: "update")
.setParam(key: "id", value: id)
Expand Down
14 changes: 6 additions & 8 deletions KalturaClient/Classes/Services/FollowTvSeriesService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public final class FollowTvSeriesService{
}
}

/** (Deprecated - use personalList.add) Add a user&amp;#39;s tv series
follow. Possible status codes: UserAlreadyFollowing = 8013,
NotFound = 500007, InvalidAssetId = 4024 */
/** Add a user&amp;#39;s tv series follow. Possible status codes:
UserAlreadyFollowing = 8013, NotFound = 500007, InvalidAssetId = 4024 */
public static func add(followTvSeries: FollowTvSeries) -> RequestBuilder<FollowTvSeries, FollowTvSeries.FollowTvSeriesTokenizer, AddTokenizer> {
let request: RequestBuilder<FollowTvSeries, FollowTvSeries.FollowTvSeriesTokenizer, AddTokenizer> = RequestBuilder<FollowTvSeries, FollowTvSeries.FollowTvSeriesTokenizer, AddTokenizer>(service: "followtvseries", action: "add")
.setParam(key: "followTvSeries", value: followTvSeries)
Expand All @@ -61,9 +60,9 @@ public final class FollowTvSeriesService{
}
}

/** (Deprecated - use personalList.delete) Delete a user&amp;#39;s tv
series follow. Possible status codes: UserNotFollowing = 8012,
NotFound = 500007, InvalidAssetId = 4024, AnnouncementNotFound = 8006 */
/** Delete a user&amp;#39;s tv series follow. Possible status codes:
UserNotFollowing = 8012, NotFound = 500007, InvalidAssetId = 4024,
AnnouncementNotFound = 8006 */
public static func delete(assetId: Int) -> RequestBuilder<Bool, BaseTokenizedObject, DeleteTokenizer> {
let request: RequestBuilder<Bool, BaseTokenizedObject, DeleteTokenizer> = RequestBuilder<Bool, BaseTokenizedObject, DeleteTokenizer>(service: "followtvseries", action: "delete")
.setParam(key: "assetId", value: assetId)
Expand Down Expand Up @@ -117,8 +116,7 @@ public final class FollowTvSeriesService{
return list(filter: filter, pager: nil)
}

/** (Deprecated - use personalList.list) List user&amp;#39;s tv series
follows. Possible status codes: */
/** List user&amp;#39;s tv series follows. Possible status codes: */
public static func list(filter: FollowTvSeriesFilter, pager: FilterPager?) -> RequestBuilder<FollowTvSeriesListResponse, FollowTvSeriesListResponse.FollowTvSeriesListResponseTokenizer, ListTokenizer> {
let request: RequestBuilder<FollowTvSeriesListResponse, FollowTvSeriesListResponse.FollowTvSeriesListResponseTokenizer, ListTokenizer> = RequestBuilder<FollowTvSeriesListResponse, FollowTvSeriesListResponse.FollowTvSeriesListResponseTokenizer, ListTokenizer>(service: "followtvseries", action: "list")
.setParam(key: "filter", value: filter)
Expand Down
2 changes: 1 addition & 1 deletion KalturaOttClient.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'KalturaOttClient'
s.version = '5.0.1.14736'
s.version = '5.0.1.15905'
s.summary = 'KalturaOttClient.'
s.homepage = 'https://github.com/kaltura/clients-generator/tree/master/sources/swift'
s.license = { :type => 'AGPLv3', :text => 'AGPLv3' }
Expand Down
2 changes: 1 addition & 1 deletion KalturaOttClient.spec.header
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'KalturaOttClient'
s.version = '5.0.1.14736'
s.version = '5.0.1.15905'
s.summary = 'KalturaOttClient.'
s.homepage = 'https://github.com/kaltura/clients-generator/tree/master/sources/swift'
s.license = { :type => 'AGPLv3', :text => 'AGPLv3' }
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KalturaOttClient

[![CI Status](http://img.shields.io/travis/kaltura/KalturaGeneratedAPIClientsSwift.svg?style=flat)](https://travis-ci.org/kaltura/KalturaGeneratedAPIClientsSwift)
[![CI Status](http://img.shields.io/travis/kaltura/KalturaOttGeneratedAPIClientsSwift.svg?style=flat)](https://travis-ci.org/kaltura/KalturaOttGeneratedAPIClientsSwift)
[![Version](https://img.shields.io/cocoapods/v/KalturaOttClient.svg?style=flat)](http://cocoapods.org/pods/KalturaOttClient)
[![License](https://img.shields.io/cocoapods/l/KalturaOttClient.svg?style=flat)](http://cocoapods.org/pods/KalturaOttClient)
[![Platform](https://img.shields.io/cocoapods/p/KalturaOttClient.svg?style=flat)](http://cocoapods.org/pods/KalturaOttClient)
Expand Down Expand Up @@ -28,11 +28,11 @@ [email protected]
All code in this project is released under the [AGPLv3 license](http://www.gnu.org/licenses/agpl-3.0.html) unless a different license for a particular library is specified in the applicable library path.

Copyright © Kaltura Inc. All rights reserved.
Authors and contributors: See [GitHub contributors list](https://github.com/kaltura/playkit-ios-samples/graphs/contributors).
Authors and contributors: See [GitHub contributors list](https://github.com/kaltura/KalturaOttGeneratedAPIClientsSwift/graphs/contributors).

## Publishing

```ruby
pod lib lint --fail-fast --allow-warnings
pod trunk push KalturaOttClient.podspec --allow-warnings
```
```