import { Content } from '../../models/content/content';
import { ResultBase } from '../../models/http/resultBase';
import { UserDetails } from '../../models/users/userDetails';
import { HttpCommandBase } from '../abstract/httpCommandBase';
import { HttpMethod } from '../abstract/httpMethod';

export class GetContentCommand extends HttpCommandBase<UserDetails, Content, ResultBase> {
    public endpoint: string = '/content';
    public method: HttpMethod = HttpMethod.Get;

    constructor(private contentId: string, private externalId: string | null) {
        super();
    }

    public buildEndpoint(): string {
        return `${this.endpoint}/${this.contentId}`;
    }

    public buildRequestContent(): UserDetails {
        return new UserDetails(this.externalId);
    }
}