export interface KongService {
    id?: string
    name?: string
    host?: string
    tags?: Array<string>
    protocol?: string
    port?: number
    path?: string
    connect_timeout?: number
    write_timeout?: number
    read_timeout?: number
    created_at?: number
    updated_at?: number
    retries?: number
}

export interface KongRoute {
    id?: string
    created_at?: number
    updated_at?: number
    name?: string
    protocols?: Array<string>, //[http, https]
    methods?: Array<string>// [GET, POST],
    hosts?: Array<string>// [example.com, foo.test],
    paths?: Array<string>// [/foo, /bar],
    headers?: any//{x-another-header:[bla], x-my-header:[foo, bar]},
    https_redirect_status_code?: number// 426,
    regex_priority?: number// 0,
    strip_path?: boolean// true,
    path_handling?: string// v0,
    preserve_host?: boolean// false,
    request_buffering?: boolean// true,
    response_buffering?: boolean// true,
    tags?: Array<string>
    service?: KongObj //{"id":"af8330d3-dbdc-48bd-b1be-55b98608834b"}
}



export interface KongPlugin {

    id?: string
    name?: string
    service?: KongObj
    route?: KongObj
    consumer?: KongObj
    config?: any
    protocols?: Array<string>
    enabled?: boolean
    tags?: Array<string>
}

export interface KongRoute {
    id?: string
    created_at?: number
    updated_at?: number,
    name?: string
    protocols?: Array<string>//[http, https],
    methods?: Array<string>//[GET, POST],
    hosts?: Array<string>//[example.com, foo.test],
    paths?: Array<string>//[/foo, /bar],
    headers?: any;//{x-another-header:[bla], x-my-header:[foo, bar]},
    https_redirect_status_code?: number//426,
    regex_priority?: number//0,
    strip_path?: boolean//true,
    path_handling?: string,
    preserve_host?: boolean//false,
    request_buffering?: boolean//true,
    response_buffering?: boolean//true,
    tags?: Array<string>//[user-level, low-priority],
    service?: KongObj
}

export interface KongTarget {
    id?: string
    upstream?: KongObj
    created_at?: number
    target?: string //127.0.0.1:8000
    weight?: number //100
    tags?: Array<string>//[user-level, low-priority],
}

export interface KongUpstream {
    id?: string
    created_at?: number
    hash_on?: string
    tags?: Array<string>//[user-level, low-priority],
    name?: string
    hash_fallback_header?: string
    hash_on_cookie?: string
    healthchecks?: any
}

export interface KongObj {

    id?: string
}