Merge in DNS/adguard-home from beta-client-2 to master
Squashed commit of the following:
commit b2640cc49a6c5484d730b534dcf5a8013d7fa478
Merge: 659def862 aef4659e9
Author: Eugene Burkov <e.burkov@adguard.com>
Date: Tue Dec 29 19:23:09 2020 +0300
Merge branch 'master' into beta-client-2
commit 659def8626467949c35b7a6a0c99ffafb07b4385
Author: Eugene Burkov <e.burkov@adguard.com>
Date: Tue Dec 29 17:25:14 2020 +0300
all: upgrade github actions node version
commit b4b8cf8dd75672e9155da5d111ac66e8f5ba1535
Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com>
Date: Tue Dec 29 16:57:14 2020 +0300
all: beta client squashed
65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
// This file was autogenerated. Please do not change.
|
|
// All changes will be overwrited on commit.
|
|
export interface IDhcpSearchResultStaticIP {
|
|
ip?: string;
|
|
static?: string;
|
|
}
|
|
|
|
export default class DhcpSearchResultStaticIP {
|
|
readonly _ip: string | undefined;
|
|
|
|
/** */
|
|
get ip(): string | undefined {
|
|
return this._ip;
|
|
}
|
|
|
|
readonly _static: string | undefined;
|
|
|
|
/**
|
|
* Description: yes|no|error
|
|
* Example: yes
|
|
*/
|
|
get static(): string | undefined {
|
|
return this._static;
|
|
}
|
|
|
|
constructor(props: IDhcpSearchResultStaticIP) {
|
|
if (typeof props.ip === 'string') {
|
|
this._ip = props.ip.trim();
|
|
}
|
|
if (typeof props.static === 'string') {
|
|
this._static = props.static.trim();
|
|
}
|
|
}
|
|
|
|
serialize(): IDhcpSearchResultStaticIP {
|
|
const data: IDhcpSearchResultStaticIP = {
|
|
};
|
|
if (typeof this._ip !== 'undefined') {
|
|
data.ip = this._ip;
|
|
}
|
|
if (typeof this._static !== 'undefined') {
|
|
data.static = this._static;
|
|
}
|
|
return data;
|
|
}
|
|
|
|
validate(): string[] {
|
|
const validate = {
|
|
static: !this._static ? true : typeof this._static === 'string' && !this._static ? true : this._static,
|
|
ip: !this._ip ? true : typeof this._ip === 'string' && !this._ip ? true : this._ip,
|
|
};
|
|
const isError: string[] = [];
|
|
Object.keys(validate).forEach((key) => {
|
|
if (!(validate as any)[key]) {
|
|
isError.push(key);
|
|
}
|
|
});
|
|
return isError;
|
|
}
|
|
|
|
update(props: Partial<IDhcpSearchResultStaticIP>): DhcpSearchResultStaticIP {
|
|
return new DhcpSearchResultStaticIP({ ...this.serialize(), ...props });
|
|
}
|
|
}
|