-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APD-XXX] Send correct price on creating mediation group
- Loading branch information
1 parent
b2dfe1a
commit d65aeb7
Showing
4 changed files
with
136 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {ArrayTranslator} from 'lib/translators/base-translators/array.translator'; | ||
import {ObjectTranslator} from 'lib/translators/base-translators/object.translator'; | ||
import {AdmobCustomEvent, AdmobCustomEventParam} from 'lib/translators/interfaces/admob-ad-unit.interface'; | ||
import {getTranslator} from 'lib/translators/translator.helpers'; | ||
|
||
|
||
export class AdmobCustomEventParamTranslator extends ObjectTranslator<AdmobCustomEventParam> { | ||
constructor () { | ||
super({ | ||
1: 'key', | ||
2: 'value' | ||
}); | ||
} | ||
} | ||
|
||
export class AdmobCustomEventParamsArrayTranslator extends ArrayTranslator<AdmobCustomEvent> { | ||
constructor () { | ||
super(getTranslator(AdmobCustomEventParamTranslator)); | ||
} | ||
|
||
} | ||
|
||
export class AdmobCustomEventTranslator extends ObjectTranslator<AdmobCustomEvent> { | ||
|
||
constructor () { | ||
super({ | ||
1: 'eventId', | ||
4: ['params', AdmobCustomEventParamsArrayTranslator], | ||
12: 'adUnitId', | ||
15: 'label' | ||
|
||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {ITranslator} from './translator.interface'; | ||
|
||
|
||
export abstract class ArrayTranslator<T> implements ITranslator { | ||
|
||
protected constructor (private t: ITranslator) { | ||
} | ||
|
||
public decode = (source: any[]): T[] => { | ||
return source.map(v => this.t.decode(v)); | ||
}; | ||
|
||
public encode = (source: Partial<T>[]): T[] => { | ||
return source.map(v => this.t.encode(v)); | ||
|
||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters