/*
 * OPEN OUTCRY API
 *
 * # Introduction This API is documented in **OpenAPI 3.0 format**.  This API the following operations: * Retrieve a list of available instruments * Retrieve a list of executed trades  # Basics * API calls have to be secured with HTTPS. * All data has to be submitted UTF-8 encoded. * The reply is sent JSON encoded.
 *
 * API version: 1.0.0
 * Generated by: OpenAPI Generator (https://openapi-generator.tech)
 */

package api

import (
	"fmt"
)

type PaymentType string

// List of PaymentType
const (
	DEPOSIT         PaymentType = "DEPOSIT"
	WITHDRAWAL      PaymentType = "WITHDRAWAL"
	TRANSFER        PaymentType = "TRANSFER"
	INSTRUMENT_BUY  PaymentType = "INSTRUMENT_BUY"
	INSTRUMENT_SELL PaymentType = "INSTRUMENT_SELL"
	CHARGE          PaymentType = "CHARGE"
)

// AllowedPaymentTypeEnumValues is all the allowed values of PaymentType enum
var AllowedPaymentTypeEnumValues = []PaymentType{
	"DEPOSIT",
	"WITHDRAWAL",
	"TRANSFER",
	"INSTRUMENT_BUY",
	"INSTRUMENT_SELL",
	"CHARGE",
}

// validPaymentTypeEnumValue provides a map of PaymentTypes for fast verification of use input
var validPaymentTypeEnumValues = map[PaymentType]struct{}{
	"DEPOSIT":         {},
	"WITHDRAWAL":      {},
	"TRANSFER":        {},
	"INSTRUMENT_BUY":  {},
	"INSTRUMENT_SELL": {},
	"CHARGE":          {},
}

// IsValid return true if the value is valid for the enum, false otherwise
func (v PaymentType) IsValid() bool {
	_, ok := validPaymentTypeEnumValues[v]
	return ok
}

// NewPaymentTypeFromValue returns a pointer to a valid PaymentType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewPaymentTypeFromValue(v string) (PaymentType, error) {
	ev := PaymentType(v)
	if ev.IsValid() {
		return ev, nil
	} else {
		return "", fmt.Errorf("invalid value '%v' for PaymentType: valid values are %v", v, AllowedPaymentTypeEnumValues)
	}
}

// AssertPaymentTypeRequired checks if the required fields are not zero-ed
func AssertPaymentTypeRequired(obj PaymentType) error {
	return nil
}

// AssertPaymentTypeConstraints checks if the values respects the defined constraints
func AssertPaymentTypeConstraints(obj PaymentType) error {
	return nil
}
