member_webapp/@overflow/probe/store/entity/probe/probe.action.ts
2018-05-25 20:59:18 +09:00

84 lines
2.1 KiB
TypeScript

import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
export enum ActionType {
ReadAllByDomainID = '[probe.list] ReadAllByDomainID',
ReadAllByDomainIDSuccess = '[probe.list] ReadAllByDomainIDSuccess',
ReadAllByDomainIDFailure = '[probe.list] ReadAllByDomainIDFailure',
Read = '[probe.detail] Read',
ReadSuccess = '[probe.detail] ReadSuccess',
ReadFailure = '[probe.detail] ReadFailure',
Modify = '[probe.detail] Modify',
ModifySuccess = '[probe.detail] ModifySuccess',
ModifyFailure = '[probe.detail] ModifyFailure',
}
export class ReadAllByDomainID implements Action {
readonly type = ActionType.ReadAllByDomainID;
constructor(public payload: number) {}
}
export class ReadAllByDomainIDSuccess implements Action {
readonly type = ActionType.ReadAllByDomainIDSuccess;
constructor(public payload: ProbeHost[]) {}
}
export class ReadAllByDomainIDFailure implements Action {
readonly type = ActionType.ReadAllByDomainIDFailure;
constructor(public payload: RPCClientError) {}
}
export class Read implements Action {
readonly type = ActionType.Read;
constructor(public payload: number) {}
}
export class ReadSuccess implements Action {
readonly type = ActionType.ReadSuccess;
constructor(public payload: ProbeHost) {}
}
export class ReadFailure implements Action {
readonly type = ActionType.ReadFailure;
constructor(public payload: RPCClientError) {}
}
export class Modify implements Action {
readonly type = ActionType.Modify;
constructor(public payload: Probe) {}
}
export class ModifySuccess implements Action {
readonly type = ActionType.ModifySuccess;
constructor(public payload: ProbeHost) {}
}
export class ModifyFailure implements Action {
readonly type = ActionType.ModifyFailure;
constructor(public payload: RPCClientError) {}
}
export type Actions =
| ReadAllByDomainID
| ReadAllByDomainIDSuccess
| ReadAllByDomainIDFailure
| Read
| ReadSuccess
| ReadFailure
| Modify
| ModifySuccess
| ModifyFailure
;