///<reference path='./../core.d.ts'/>
///<reference path='./../index.d.ts'/>
///<reference path='./filter.d.ts'/>
declare module 'chargebee' {
  export interface OmnichannelSubscription {
    id: string;
    id_at_source: string;
    app_id: string;
    source: 'apple_app_store' | 'google_play_store';
    customer_id?: string;
    created_at: number;
    purchased_at?: number;
    updated_at: number;
    resource_version?: number;
    omnichannel_subscription_items: OmnichannelSubscriptionItem[];
    initial_purchase_transaction?: OmnichannelTransaction;
  }

  export namespace OmnichannelSubscription {
    export class OmnichannelSubscriptionResource {
      retrieve(
        omnichannel_subscription_id: string,
        headers?: ChargebeeRequestHeader,
      ): Promise<ChargebeeResponse<RetrieveResponse>>;

      list(
        input?: ListInputParam,
        headers?: ChargebeeRequestHeader,
      ): Promise<ChargebeeResponse<ListResponse>>;

      omnichannelTransactionsForOmnichannelSubscription(
        omnichannel_subscription_id: string,
        input?: OmnichannelTransactionsForOmnichannelSubscriptionInputParam,
        headers?: ChargebeeRequestHeader,
      ): Promise<
        ChargebeeResponse<OmnichannelTransactionsForOmnichannelSubscriptionResponse>
      >;

      move(
        omnichannel_subscription_id: string,
        input: MoveInputParam,
        headers?: ChargebeeRequestHeader,
      ): Promise<ChargebeeResponse<MoveResponse>>;
    }

    export interface RetrieveResponse {
      omnichannel_subscription: OmnichannelSubscription;
    }

    export interface ListResponse {
      list: { omnichannel_subscription: OmnichannelSubscription }[];
      next_offset?: string;
    }

    export interface OmnichannelTransactionsForOmnichannelSubscriptionResponse {
      list: { omnichannel_transaction: OmnichannelTransaction }[];
      next_offset?: string;
    }

    export interface MoveResponse {
      omnichannel_subscription: OmnichannelSubscription;
    }

    // REQUEST PARAMS
    //---------------

    export interface ListInputParam {
      limit?: number;
      offset?: string;
      omnichannel_subscription_item?: OmnichannelSubscriptionItemOmnichannelSubscriptionListInputParam;
      source?: filter.Enum;
      customer_id?: filter.String;
      id?: filter.String;
      id_at_source?: filter.String;
      updated_at?: filter.Timestamp;
      purchased_at?: filter.Timestamp;
      'sort_by[asc]'?: string;
      'sort_by[desc]'?: string;
    }
    export interface OmnichannelTransactionsForOmnichannelSubscriptionInputParam {
      limit?: number;
      offset?: string;
    }
    export interface MoveInputParam {
      to_customer_id: string;
    }
    export interface OmnichannelSubscriptionItemOmnichannelSubscriptionListInputParam {
      status?: filter.Enum;
      item_id_at_source?: filter.String;
    }
  }
}
