/* eslint-disable */
/** This file was generated by the graphql-errors-plugin, which is part of the "codegen" npm script. */

export type Scalars = {
  ID: string;
  String: string;
  Boolean: boolean;
  Int: number;
  Float: number;
  DateTime: any;
  JSON: any;
  Money: any;
  Upload: any;
};

export class ErrorResult {
  readonly __typename: string;
  readonly errorCode: string;
  readonly message: Scalars['String'];
}

export class AlreadyRefundedError extends ErrorResult {
  readonly __typename = 'AlreadyRefundedError';
  readonly errorCode = 'ALREADY_REFUNDED_ERROR' as any;
  readonly message = 'ALREADY_REFUNDED_ERROR';
  readonly refundId: Scalars['ID'];
  constructor(
    input: { refundId: Scalars['ID'] }
  ) {
    super();
    this.refundId = input.refundId
  }
}

export class CancelActiveOrderError extends ErrorResult {
  readonly __typename = 'CancelActiveOrderError';
  readonly errorCode = 'CANCEL_ACTIVE_ORDER_ERROR' as any;
  readonly message = 'CANCEL_ACTIVE_ORDER_ERROR';
  readonly orderState: Scalars['String'];
  constructor(
    input: { orderState: Scalars['String'] }
  ) {
    super();
    this.orderState = input.orderState
  }
}

export class CancelPaymentError extends ErrorResult {
  readonly __typename = 'CancelPaymentError';
  readonly errorCode = 'CANCEL_PAYMENT_ERROR' as any;
  readonly message = 'CANCEL_PAYMENT_ERROR';
  readonly paymentErrorMessage: Scalars['String'];
  constructor(
    input: { paymentErrorMessage: Scalars['String'] }
  ) {
    super();
    this.paymentErrorMessage = input.paymentErrorMessage
  }
}

export class ChannelDefaultLanguageError extends ErrorResult {
  readonly __typename = 'ChannelDefaultLanguageError';
  readonly errorCode = 'CHANNEL_DEFAULT_LANGUAGE_ERROR' as any;
  readonly message = 'CHANNEL_DEFAULT_LANGUAGE_ERROR';
  readonly channelCode: Scalars['String'];
  readonly language: Scalars['String'];
  constructor(
    input: { channelCode: Scalars['String'], language: Scalars['String'] }
  ) {
    super();
    this.channelCode = input.channelCode
    this.language = input.language
  }
}

export class CouponCodeExpiredError extends ErrorResult {
  readonly __typename = 'CouponCodeExpiredError';
  readonly errorCode = 'COUPON_CODE_EXPIRED_ERROR' as any;
  readonly message = 'COUPON_CODE_EXPIRED_ERROR';
  readonly couponCode: Scalars['String'];
  constructor(
    input: { couponCode: Scalars['String'] }
  ) {
    super();
    this.couponCode = input.couponCode
  }
}

export class CouponCodeInvalidError extends ErrorResult {
  readonly __typename = 'CouponCodeInvalidError';
  readonly errorCode = 'COUPON_CODE_INVALID_ERROR' as any;
  readonly message = 'COUPON_CODE_INVALID_ERROR';
  readonly couponCode: Scalars['String'];
  constructor(
    input: { couponCode: Scalars['String'] }
  ) {
    super();
    this.couponCode = input.couponCode
  }
}

export class CouponCodeLimitError extends ErrorResult {
  readonly __typename = 'CouponCodeLimitError';
  readonly errorCode = 'COUPON_CODE_LIMIT_ERROR' as any;
  readonly message = 'COUPON_CODE_LIMIT_ERROR';
  readonly couponCode: Scalars['String'];
  readonly limit: Scalars['Int'];
  constructor(
    input: { couponCode: Scalars['String'], limit: Scalars['Int'] }
  ) {
    super();
    this.couponCode = input.couponCode
    this.limit = input.limit
  }
}

export class CreateFulfillmentError extends ErrorResult {
  readonly __typename = 'CreateFulfillmentError';
  readonly errorCode = 'CREATE_FULFILLMENT_ERROR' as any;
  readonly message = 'CREATE_FULFILLMENT_ERROR';
  readonly fulfillmentHandlerError: Scalars['String'];
  constructor(
    input: { fulfillmentHandlerError: Scalars['String'] }
  ) {
    super();
    this.fulfillmentHandlerError = input.fulfillmentHandlerError
  }
}

export class EmailAddressConflictError extends ErrorResult {
  readonly __typename = 'EmailAddressConflictError';
  readonly errorCode = 'EMAIL_ADDRESS_CONFLICT_ERROR' as any;
  readonly message = 'EMAIL_ADDRESS_CONFLICT_ERROR';
  constructor(

  ) {
    super();
  }
}

export class EmptyOrderLineSelectionError extends ErrorResult {
  readonly __typename = 'EmptyOrderLineSelectionError';
  readonly errorCode = 'EMPTY_ORDER_LINE_SELECTION_ERROR' as any;
  readonly message = 'EMPTY_ORDER_LINE_SELECTION_ERROR';
  constructor(

  ) {
    super();
  }
}

export class FacetInUseError extends ErrorResult {
  readonly __typename = 'FacetInUseError';
  readonly errorCode = 'FACET_IN_USE_ERROR' as any;
  readonly message = 'FACET_IN_USE_ERROR';
  readonly facetCode: Scalars['String'];
  readonly productCount: Scalars['Int'];
  readonly variantCount: Scalars['Int'];
  constructor(
    input: { facetCode: Scalars['String'], productCount: Scalars['Int'], variantCount: Scalars['Int'] }
  ) {
    super();
    this.facetCode = input.facetCode
    this.productCount = input.productCount
    this.variantCount = input.variantCount
  }
}

export class FulfillmentStateTransitionError extends ErrorResult {
  readonly __typename = 'FulfillmentStateTransitionError';
  readonly errorCode = 'FULFILLMENT_STATE_TRANSITION_ERROR' as any;
  readonly message = 'FULFILLMENT_STATE_TRANSITION_ERROR';
  readonly fromState: Scalars['String'];
  readonly toState: Scalars['String'];
  readonly transitionError: Scalars['String'];
  constructor(
    input: { fromState: Scalars['String'], toState: Scalars['String'], transitionError: Scalars['String'] }
  ) {
    super();
    this.fromState = input.fromState
    this.toState = input.toState
    this.transitionError = input.transitionError
  }
}

export class GuestCheckoutError extends ErrorResult {
  readonly __typename = 'GuestCheckoutError';
  readonly errorCode = 'GUEST_CHECKOUT_ERROR' as any;
  readonly message = 'GUEST_CHECKOUT_ERROR';
  readonly errorDetail: Scalars['String'];
  constructor(
    input: { errorDetail: Scalars['String'] }
  ) {
    super();
    this.errorDetail = input.errorDetail
  }
}

export class IneligibleShippingMethodError extends ErrorResult {
  readonly __typename = 'IneligibleShippingMethodError';
  readonly errorCode = 'INELIGIBLE_SHIPPING_METHOD_ERROR' as any;
  readonly message = 'INELIGIBLE_SHIPPING_METHOD_ERROR';
  constructor(

  ) {
    super();
  }
}

export class InsufficientStockError extends ErrorResult {
  readonly __typename = 'InsufficientStockError';
  readonly errorCode = 'INSUFFICIENT_STOCK_ERROR' as any;
  readonly message = 'INSUFFICIENT_STOCK_ERROR';
  readonly order: any;
  readonly quantityAvailable: Scalars['Int'];
  constructor(
    input: { order: any, quantityAvailable: Scalars['Int'] }
  ) {
    super();
    this.order = input.order
    this.quantityAvailable = input.quantityAvailable
  }
}

export class InsufficientStockOnHandError extends ErrorResult {
  readonly __typename = 'InsufficientStockOnHandError';
  readonly errorCode = 'INSUFFICIENT_STOCK_ON_HAND_ERROR' as any;
  readonly message = 'INSUFFICIENT_STOCK_ON_HAND_ERROR';
  readonly productVariantId: Scalars['ID'];
  readonly productVariantName: Scalars['String'];
  readonly stockOnHand: Scalars['Int'];
  constructor(
    input: { productVariantId: Scalars['ID'], productVariantName: Scalars['String'], stockOnHand: Scalars['Int'] }
  ) {
    super();
    this.productVariantId = input.productVariantId
    this.productVariantName = input.productVariantName
    this.stockOnHand = input.stockOnHand
  }
}

export class InvalidCredentialsError extends ErrorResult {
  readonly __typename = 'InvalidCredentialsError';
  readonly errorCode = 'INVALID_CREDENTIALS_ERROR' as any;
  readonly message = 'INVALID_CREDENTIALS_ERROR';
  readonly authenticationError: Scalars['String'];
  constructor(
    input: { authenticationError: Scalars['String'] }
  ) {
    super();
    this.authenticationError = input.authenticationError
  }
}

export class InvalidFulfillmentHandlerError extends ErrorResult {
  readonly __typename = 'InvalidFulfillmentHandlerError';
  readonly errorCode = 'INVALID_FULFILLMENT_HANDLER_ERROR' as any;
  readonly message = 'INVALID_FULFILLMENT_HANDLER_ERROR';
  constructor(

  ) {
    super();
  }
}

export class ItemsAlreadyFulfilledError extends ErrorResult {
  readonly __typename = 'ItemsAlreadyFulfilledError';
  readonly errorCode = 'ITEMS_ALREADY_FULFILLED_ERROR' as any;
  readonly message = 'ITEMS_ALREADY_FULFILLED_ERROR';
  constructor(

  ) {
    super();
  }
}

export class LanguageNotAvailableError extends ErrorResult {
  readonly __typename = 'LanguageNotAvailableError';
  readonly errorCode = 'LANGUAGE_NOT_AVAILABLE_ERROR' as any;
  readonly message = 'LANGUAGE_NOT_AVAILABLE_ERROR';
  readonly languageCode: Scalars['String'];
  constructor(
    input: { languageCode: Scalars['String'] }
  ) {
    super();
    this.languageCode = input.languageCode
  }
}

export class ManualPaymentStateError extends ErrorResult {
  readonly __typename = 'ManualPaymentStateError';
  readonly errorCode = 'MANUAL_PAYMENT_STATE_ERROR' as any;
  readonly message = 'MANUAL_PAYMENT_STATE_ERROR';
  constructor(

  ) {
    super();
  }
}

export class MimeTypeError extends ErrorResult {
  readonly __typename = 'MimeTypeError';
  readonly errorCode = 'MIME_TYPE_ERROR' as any;
  readonly message = 'MIME_TYPE_ERROR';
  readonly fileName: Scalars['String'];
  readonly mimeType: Scalars['String'];
  constructor(
    input: { fileName: Scalars['String'], mimeType: Scalars['String'] }
  ) {
    super();
    this.fileName = input.fileName
    this.mimeType = input.mimeType
  }
}

export class MissingConditionsError extends ErrorResult {
  readonly __typename = 'MissingConditionsError';
  readonly errorCode = 'MISSING_CONDITIONS_ERROR' as any;
  readonly message = 'MISSING_CONDITIONS_ERROR';
  constructor(

  ) {
    super();
  }
}

export class MultipleOrderError extends ErrorResult {
  readonly __typename = 'MultipleOrderError';
  readonly errorCode = 'MULTIPLE_ORDER_ERROR' as any;
  readonly message = 'MULTIPLE_ORDER_ERROR';
  constructor(

  ) {
    super();
  }
}

export class NativeAuthStrategyError extends ErrorResult {
  readonly __typename = 'NativeAuthStrategyError';
  readonly errorCode = 'NATIVE_AUTH_STRATEGY_ERROR' as any;
  readonly message = 'NATIVE_AUTH_STRATEGY_ERROR';
  constructor(

  ) {
    super();
  }
}

export class NegativeQuantityError extends ErrorResult {
  readonly __typename = 'NegativeQuantityError';
  readonly errorCode = 'NEGATIVE_QUANTITY_ERROR' as any;
  readonly message = 'NEGATIVE_QUANTITY_ERROR';
  constructor(

  ) {
    super();
  }
}

export class NoActiveOrderError extends ErrorResult {
  readonly __typename = 'NoActiveOrderError';
  readonly errorCode = 'NO_ACTIVE_ORDER_ERROR' as any;
  readonly message = 'NO_ACTIVE_ORDER_ERROR';
  constructor(

  ) {
    super();
  }
}

export class NoChangesSpecifiedError extends ErrorResult {
  readonly __typename = 'NoChangesSpecifiedError';
  readonly errorCode = 'NO_CHANGES_SPECIFIED_ERROR' as any;
  readonly message = 'NO_CHANGES_SPECIFIED_ERROR';
  constructor(

  ) {
    super();
  }
}

export class NothingToRefundError extends ErrorResult {
  readonly __typename = 'NothingToRefundError';
  readonly errorCode = 'NOTHING_TO_REFUND_ERROR' as any;
  readonly message = 'NOTHING_TO_REFUND_ERROR';
  constructor(

  ) {
    super();
  }
}

export class OrderLimitError extends ErrorResult {
  readonly __typename = 'OrderLimitError';
  readonly errorCode = 'ORDER_LIMIT_ERROR' as any;
  readonly message = 'ORDER_LIMIT_ERROR';
  readonly maxItems: Scalars['Int'];
  constructor(
    input: { maxItems: Scalars['Int'] }
  ) {
    super();
    this.maxItems = input.maxItems
  }
}

export class OrderModificationError extends ErrorResult {
  readonly __typename = 'OrderModificationError';
  readonly errorCode = 'ORDER_MODIFICATION_ERROR' as any;
  readonly message = 'ORDER_MODIFICATION_ERROR';
  constructor(

  ) {
    super();
  }
}

export class OrderModificationStateError extends ErrorResult {
  readonly __typename = 'OrderModificationStateError';
  readonly errorCode = 'ORDER_MODIFICATION_STATE_ERROR' as any;
  readonly message = 'ORDER_MODIFICATION_STATE_ERROR';
  constructor(

  ) {
    super();
  }
}

export class OrderStateTransitionError extends ErrorResult {
  readonly __typename = 'OrderStateTransitionError';
  readonly errorCode = 'ORDER_STATE_TRANSITION_ERROR' as any;
  readonly message = 'ORDER_STATE_TRANSITION_ERROR';
  readonly fromState: Scalars['String'];
  readonly toState: Scalars['String'];
  readonly transitionError: Scalars['String'];
  constructor(
    input: { fromState: Scalars['String'], toState: Scalars['String'], transitionError: Scalars['String'] }
  ) {
    super();
    this.fromState = input.fromState
    this.toState = input.toState
    this.transitionError = input.transitionError
  }
}

export class PaymentMethodMissingError extends ErrorResult {
  readonly __typename = 'PaymentMethodMissingError';
  readonly errorCode = 'PAYMENT_METHOD_MISSING_ERROR' as any;
  readonly message = 'PAYMENT_METHOD_MISSING_ERROR';
  constructor(

  ) {
    super();
  }
}

export class PaymentOrderMismatchError extends ErrorResult {
  readonly __typename = 'PaymentOrderMismatchError';
  readonly errorCode = 'PAYMENT_ORDER_MISMATCH_ERROR' as any;
  readonly message = 'PAYMENT_ORDER_MISMATCH_ERROR';
  constructor(

  ) {
    super();
  }
}

export class PaymentStateTransitionError extends ErrorResult {
  readonly __typename = 'PaymentStateTransitionError';
  readonly errorCode = 'PAYMENT_STATE_TRANSITION_ERROR' as any;
  readonly message = 'PAYMENT_STATE_TRANSITION_ERROR';
  readonly fromState: Scalars['String'];
  readonly toState: Scalars['String'];
  readonly transitionError: Scalars['String'];
  constructor(
    input: { fromState: Scalars['String'], toState: Scalars['String'], transitionError: Scalars['String'] }
  ) {
    super();
    this.fromState = input.fromState
    this.toState = input.toState
    this.transitionError = input.transitionError
  }
}

export class ProductOptionInUseError extends ErrorResult {
  readonly __typename = 'ProductOptionInUseError';
  readonly errorCode = 'PRODUCT_OPTION_IN_USE_ERROR' as any;
  readonly message = 'PRODUCT_OPTION_IN_USE_ERROR';
  readonly optionGroupCode: Scalars['String'];
  readonly productVariantCount: Scalars['Int'];
  constructor(
    input: { optionGroupCode: Scalars['String'], productVariantCount: Scalars['Int'] }
  ) {
    super();
    this.optionGroupCode = input.optionGroupCode
    this.productVariantCount = input.productVariantCount
  }
}

export class QuantityTooGreatError extends ErrorResult {
  readonly __typename = 'QuantityTooGreatError';
  readonly errorCode = 'QUANTITY_TOO_GREAT_ERROR' as any;
  readonly message = 'QUANTITY_TOO_GREAT_ERROR';
  constructor(

  ) {
    super();
  }
}

export class RefundOrderStateError extends ErrorResult {
  readonly __typename = 'RefundOrderStateError';
  readonly errorCode = 'REFUND_ORDER_STATE_ERROR' as any;
  readonly message = 'REFUND_ORDER_STATE_ERROR';
  readonly orderState: Scalars['String'];
  constructor(
    input: { orderState: Scalars['String'] }
  ) {
    super();
    this.orderState = input.orderState
  }
}

export class RefundPaymentIdMissingError extends ErrorResult {
  readonly __typename = 'RefundPaymentIdMissingError';
  readonly errorCode = 'REFUND_PAYMENT_ID_MISSING_ERROR' as any;
  readonly message = 'REFUND_PAYMENT_ID_MISSING_ERROR';
  constructor(

  ) {
    super();
  }
}

export class RefundStateTransitionError extends ErrorResult {
  readonly __typename = 'RefundStateTransitionError';
  readonly errorCode = 'REFUND_STATE_TRANSITION_ERROR' as any;
  readonly message = 'REFUND_STATE_TRANSITION_ERROR';
  readonly fromState: Scalars['String'];
  readonly toState: Scalars['String'];
  readonly transitionError: Scalars['String'];
  constructor(
    input: { fromState: Scalars['String'], toState: Scalars['String'], transitionError: Scalars['String'] }
  ) {
    super();
    this.fromState = input.fromState
    this.toState = input.toState
    this.transitionError = input.transitionError
  }
}

export class SettlePaymentError extends ErrorResult {
  readonly __typename = 'SettlePaymentError';
  readonly errorCode = 'SETTLE_PAYMENT_ERROR' as any;
  readonly message = 'SETTLE_PAYMENT_ERROR';
  readonly paymentErrorMessage: Scalars['String'];
  constructor(
    input: { paymentErrorMessage: Scalars['String'] }
  ) {
    super();
    this.paymentErrorMessage = input.paymentErrorMessage
  }
}


const errorTypeNames = new Set<string>(['AlreadyRefundedError', 'CancelActiveOrderError', 'CancelPaymentError', 'ChannelDefaultLanguageError', 'CouponCodeExpiredError', 'CouponCodeInvalidError', 'CouponCodeLimitError', 'CreateFulfillmentError', 'EmailAddressConflictError', 'EmptyOrderLineSelectionError', 'FacetInUseError', 'FulfillmentStateTransitionError', 'GuestCheckoutError', 'IneligibleShippingMethodError', 'InsufficientStockError', 'InsufficientStockOnHandError', 'InvalidCredentialsError', 'InvalidFulfillmentHandlerError', 'ItemsAlreadyFulfilledError', 'LanguageNotAvailableError', 'ManualPaymentStateError', 'MimeTypeError', 'MissingConditionsError', 'MultipleOrderError', 'NativeAuthStrategyError', 'NegativeQuantityError', 'NoActiveOrderError', 'NoChangesSpecifiedError', 'NothingToRefundError', 'OrderLimitError', 'OrderModificationError', 'OrderModificationStateError', 'OrderStateTransitionError', 'PaymentMethodMissingError', 'PaymentOrderMismatchError', 'PaymentStateTransitionError', 'ProductOptionInUseError', 'QuantityTooGreatError', 'RefundOrderStateError', 'RefundPaymentIdMissingError', 'RefundStateTransitionError', 'SettlePaymentError']);
function isGraphQLError(input: any): input is import('@vendure/common/lib/generated-types').ErrorResult {
  return input instanceof ErrorResult || errorTypeNames.has(input.__typename);
}

export const adminErrorOperationTypeResolvers = {
  AddFulfillmentToOrderResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Fulfillment';
    },
  },
  UpdateOrderItemsResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  AddManualPaymentToOrderResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  ApplyCouponCodeResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  AuthenticationResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'CurrentUser';
    },
  },
  CancelOrderResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  CancelPaymentResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Payment';
    },
  },
  CreateAssetResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Asset';
    },
  },
  CreateChannelResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Channel';
    },
  },
  CreateCustomerResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Customer';
    },
  },
  CreatePromotionResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Promotion';
    },
  },
  NativeAuthenticationResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'CurrentUser';
    },
  },
  ModifyOrderResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  RefundOrderResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Refund';
    },
  },
  RemoveOrderItemsResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  RemoveFacetFromChannelResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Facet';
    },
  },
  RemoveOptionGroupFromProductResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Product';
    },
  },
  SetCustomerForDraftOrderResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  SetOrderShippingMethodResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  SettlePaymentResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Payment';
    },
  },
  SettleRefundResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Refund';
    },
  },
  TransitionFulfillmentToStateResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Fulfillment';
    },
  },
  TransitionOrderToStateResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Order';
    },
  },
  TransitionPaymentToStateResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Payment';
    },
  },
  UpdateChannelResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Channel';
    },
  },
  UpdateCustomerResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Customer';
    },
  },
  UpdateGlobalSettingsResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'GlobalSettings';
    },
  },
  UpdatePromotionResult: {
    __resolveType(value: any) {
      return isGraphQLError(value) ? (value as any).__typename : 'Promotion';
    },
  },
};