// Auvik API Type Definitions

export interface AuvikNetworkInterface {
  interfaceName: string;
  status: string;
  speed?: number;
  macAddress?: string;
  ipAddress?: string;
  vlan?: string;
}

export interface AuvikDevice {
  id: string;
  deviceName: string;
  serialNumber?: string;
  macAddresses?: string[];
  ipAddresses: string[];
  deviceType: string;
  manufacturer?: string;
  model?: string;
  makeModel?: string;
  vendorName?: string;
  firmwareVersion?: string;
  softwareVersion?: string;
  onlineStatus: 'online' | 'offline' | 'unknown';
  lastSeenTime?: string;
  uptime?: number;
  tenantId: string;
  tenantName?: string;
  description?: string;
  networkInterfaces?: AuvikNetworkInterface[];
}

export interface AuvikTenant {
  id: string;
  domainPrefix: string;
  tenantType: 'multiClient' | 'client';
  parentId?: string;
}

export interface AuvikDeviceResponse {
  data: Array<{
    type: string;
    id: string;
    attributes: {
      ipAddresses: string[];
      deviceName: string;
      deviceType: string;
      makeModel?: string;
      vendorName?: string;
      softwareVersion?: string;
      serialNumber?: string;
      description?: string;
      firmwareVersion?: string;
      lastModified?: string;
      lastSeenTime?: string;
      onlineStatus: string;
    };
    relationships?: {
      tenant?: {
        data: {
          type: string;
          id: string;
          attributes?: {
            domainPrefix: string;
          };
        };
      };
    };
  }>;
  links?: {
    next?: string;
    first?: string;
    last?: string;
  };
}

export interface AuvikTenantResponse {
  data: Array<{
    type: string;
    id: string;
    attributes: {
      domainPrefix: string;
      tenantType: string;
    };
    relationships?: {
      parent?: {
        data: {
          type: string;
          id: string;
        };
      };
    };
  }>;
}

export interface AuvikClientConfig {
  apiUrl: string;
  apiUser: string;
  apiKey: string;
}

export interface AuvikTenantMapping {
  id: number;
  auvikTenantId: string;
  auvikTenantName: string;
  autotaskCompanyId: number;
  autotaskCompanyName: string;
  createdAt: string;
  updatedAt: string;
}
