/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; import type { PaymentMethod } from './PaymentMethod'; import { PaymentMethodFromJSON, PaymentMethodFromJSONTyped, PaymentMethodToJSON, PaymentMethodToJSONTyped, } from './PaymentMethod'; /** * * @export * @interface SearchTransactionsRequest */ export interface SearchTransactionsRequest { /** * * @type {string} * @memberof SearchTransactionsRequest */ search?: string | null; /** * * @type {string} * @memberof SearchTransactionsRequest */ sortBy?: SearchTransactionsRequestSortByEnum; /** * * @type {string} * @memberof SearchTransactionsRequest */ sortDirection?: SearchTransactionsRequestSortDirectionEnum; /** * * @type {number} * @memberof SearchTransactionsRequest */ perPage?: number; /** * * @type {number} * @memberof SearchTransactionsRequest */ page?: number; /** * * @type {Array} * @memberof SearchTransactionsRequest */ paymentSource?: Array; /** * * @type {Array} * @memberof SearchTransactionsRequest */ type?: Array; /** * * @type {Array} * @memberof SearchTransactionsRequest */ paymentMethod?: Array; /** * * @type {Array} * @memberof SearchTransactionsRequest */ status?: Array; /** * * @type {Date} * @memberof SearchTransactionsRequest */ beforeCreatedAt?: Date; /** * * @type {Date} * @memberof SearchTransactionsRequest */ afterCreatedAt?: Date; /** * * @type {number} * @memberof SearchTransactionsRequest */ relatedId?: number; /** * * @type {string} * @memberof SearchTransactionsRequest */ relatedType?: SearchTransactionsRequestRelatedTypeEnum; /** * * @type {boolean} * @memberof SearchTransactionsRequest */ includesRelations?: boolean; } /** * @export */ export const SearchTransactionsRequestSortByEnum = { Id: 'id', CreatedAt: 'created_at', TotalAmount: 'total_amount' } as const; export type SearchTransactionsRequestSortByEnum = typeof SearchTransactionsRequestSortByEnum[keyof typeof SearchTransactionsRequestSortByEnum]; /** * @export */ export const SearchTransactionsRequestSortDirectionEnum = { Asc: 'asc', Desc: 'desc' } as const; export type SearchTransactionsRequestSortDirectionEnum = typeof SearchTransactionsRequestSortDirectionEnum[keyof typeof SearchTransactionsRequestSortDirectionEnum]; /** * @export */ export const SearchTransactionsRequestRelatedTypeEnum = { Order: 'order', Cart: 'cart' } as const; export type SearchTransactionsRequestRelatedTypeEnum = typeof SearchTransactionsRequestRelatedTypeEnum[keyof typeof SearchTransactionsRequestRelatedTypeEnum]; /** * Check if a given object implements the SearchTransactionsRequest interface. */ export function instanceOfSearchTransactionsRequest(value: object): value is SearchTransactionsRequest { return true; } export function SearchTransactionsRequestFromJSON(json: any): SearchTransactionsRequest { return SearchTransactionsRequestFromJSONTyped(json, false); } export function SearchTransactionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchTransactionsRequest { if (json == null) { return json; } return { 'search': json['search'] == null ? undefined : json['search'], 'sortBy': json['sortBy'] == null ? undefined : json['sortBy'], 'sortDirection': json['sortDirection'] == null ? undefined : json['sortDirection'], 'perPage': json['per_page'] == null ? undefined : json['per_page'], 'page': json['page'] == null ? undefined : json['page'], 'paymentSource': json['payment_source'] == null ? undefined : json['payment_source'], 'type': json['type'] == null ? undefined : json['type'], 'paymentMethod': json['payment_method'] == null ? undefined : ((json['payment_method'] as Array).map(PaymentMethodFromJSON)), 'status': json['status'] == null ? undefined : json['status'], 'beforeCreatedAt': json['before_created_at'] == null ? undefined : (new Date(json['before_created_at'])), 'afterCreatedAt': json['after_created_at'] == null ? undefined : (new Date(json['after_created_at'])), 'relatedId': json['related_id'] == null ? undefined : json['related_id'], 'relatedType': json['related_type'] == null ? undefined : json['related_type'], 'includesRelations': json['includes_relations'] == null ? undefined : json['includes_relations'], }; } export function SearchTransactionsRequestToJSON(json: any): SearchTransactionsRequest { return SearchTransactionsRequestToJSONTyped(json, false); } export function SearchTransactionsRequestToJSONTyped(value?: SearchTransactionsRequest | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'search': value['search'], 'sortBy': value['sortBy'], 'sortDirection': value['sortDirection'], 'per_page': value['perPage'], 'page': value['page'], 'payment_source': value['paymentSource'], 'type': value['type'], 'payment_method': value['paymentMethod'] == null ? undefined : ((value['paymentMethod'] as Array).map(PaymentMethodToJSON)), 'status': value['status'], 'before_created_at': value['beforeCreatedAt'] == null ? undefined : ((value['beforeCreatedAt']).toISOString()), 'after_created_at': value['afterCreatedAt'] == null ? undefined : ((value['afterCreatedAt']).toISOString()), 'related_id': value['relatedId'], 'related_type': value['relatedType'], 'includes_relations': value['includesRelations'], }; }