/* 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'; /** * * @export * @interface SearchCouponsRequest */ export interface SearchCouponsRequest { /** * * @type {string} * @memberof SearchCouponsRequest */ search?: string | null; /** * * @type {string} * @memberof SearchCouponsRequest */ sortBy?: SearchCouponsRequestSortByEnum; /** * * @type {string} * @memberof SearchCouponsRequest */ sortDirection?: SearchCouponsRequestSortDirectionEnum; /** * * @type {number} * @memberof SearchCouponsRequest */ perPage?: number; /** * * @type {number} * @memberof SearchCouponsRequest */ page?: number; /** * * @type {Array} * @memberof SearchCouponsRequest */ type?: Array; /** * * @type {Array} * @memberof SearchCouponsRequest */ siteId?: Array; /** * * @type {Array} * @memberof SearchCouponsRequest */ isAbandonedCart?: Array; /** * * @type {Date} * @memberof SearchCouponsRequest */ beforeStartDate?: Date; /** * * @type {Date} * @memberof SearchCouponsRequest */ afterStartDate?: Date; /** * * @type {Date} * @memberof SearchCouponsRequest */ beforeEndDate?: Date; /** * * @type {Date} * @memberof SearchCouponsRequest */ afterEndDate?: Date; /** * * @type {number} * @memberof SearchCouponsRequest */ relatedId?: number; /** * * @type {string} * @memberof SearchCouponsRequest */ relatedType?: string; /** * * @type {boolean} * @memberof SearchCouponsRequest */ includesRelations?: boolean; } /** * @export */ export const SearchCouponsRequestSortByEnum = { Id: 'id', Name: 'name', Code: 'code', Type: 'type', StartDate: 'start_date', EndDate: 'end_date', CreatedAt: 'created_at' } as const; export type SearchCouponsRequestSortByEnum = typeof SearchCouponsRequestSortByEnum[keyof typeof SearchCouponsRequestSortByEnum]; /** * @export */ export const SearchCouponsRequestSortDirectionEnum = { Asc: 'asc', Desc: 'desc' } as const; export type SearchCouponsRequestSortDirectionEnum = typeof SearchCouponsRequestSortDirectionEnum[keyof typeof SearchCouponsRequestSortDirectionEnum]; /** * Check if a given object implements the SearchCouponsRequest interface. */ export function instanceOfSearchCouponsRequest(value: object): value is SearchCouponsRequest { return true; } export function SearchCouponsRequestFromJSON(json: any): SearchCouponsRequest { return SearchCouponsRequestFromJSONTyped(json, false); } export function SearchCouponsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchCouponsRequest { 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'], 'type': json['type'] == null ? undefined : json['type'], 'siteId': json['site_id'] == null ? undefined : json['site_id'], 'isAbandonedCart': json['is_abandoned_cart'] == null ? undefined : json['is_abandoned_cart'], 'beforeStartDate': json['before_start_date'] == null ? undefined : (new Date(json['before_start_date'])), 'afterStartDate': json['after_start_date'] == null ? undefined : (new Date(json['after_start_date'])), 'beforeEndDate': json['before_end_date'] == null ? undefined : (new Date(json['before_end_date'])), 'afterEndDate': json['after_end_date'] == null ? undefined : (new Date(json['after_end_date'])), '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 SearchCouponsRequestToJSON(json: any): SearchCouponsRequest { return SearchCouponsRequestToJSONTyped(json, false); } export function SearchCouponsRequestToJSONTyped(value?: SearchCouponsRequest | 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'], 'type': value['type'], 'site_id': value['siteId'], 'is_abandoned_cart': value['isAbandonedCart'], 'before_start_date': value['beforeStartDate'] == null ? undefined : ((value['beforeStartDate']).toISOString()), 'after_start_date': value['afterStartDate'] == null ? undefined : ((value['afterStartDate']).toISOString()), 'before_end_date': value['beforeEndDate'] == null ? undefined : ((value['beforeEndDate']).toISOString()), 'after_end_date': value['afterEndDate'] == null ? undefined : ((value['afterEndDate']).toISOString()), 'related_id': value['relatedId'], 'related_type': value['relatedType'], 'includes_relations': value['includesRelations'], }; }