// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// APILicenseDetailsXO Api license details x o
//
// swagger:model ApiLicenseDetailsXO
type APILicenseDetailsXO struct {

	// contact company
	ContactCompany string `json:"contactCompany,omitempty"`

	// contact email
	ContactEmail string `json:"contactEmail,omitempty"`

	// contact name
	ContactName string `json:"contactName,omitempty"`

	// effective date
	// Format: date-time
	EffectiveDate strfmt.DateTime `json:"effectiveDate,omitempty"`

	// expiration date
	// Format: date-time
	ExpirationDate strfmt.DateTime `json:"expirationDate,omitempty"`

	// features
	Features string `json:"features,omitempty"`

	// fingerprint
	Fingerprint string `json:"fingerprint,omitempty"`

	// license type
	LicenseType string `json:"licenseType,omitempty"`

	// licensed users
	LicensedUsers string `json:"licensedUsers,omitempty"`
}

// Validate validates this Api license details x o
func (m *APILicenseDetailsXO) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateEffectiveDate(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateExpirationDate(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *APILicenseDetailsXO) validateEffectiveDate(formats strfmt.Registry) error {
	if swag.IsZero(m.EffectiveDate) { // not required
		return nil
	}

	if err := validate.FormatOf("effectiveDate", "body", "date-time", m.EffectiveDate.String(), formats); err != nil {
		return err
	}

	return nil
}

func (m *APILicenseDetailsXO) validateExpirationDate(formats strfmt.Registry) error {
	if swag.IsZero(m.ExpirationDate) { // not required
		return nil
	}

	if err := validate.FormatOf("expirationDate", "body", "date-time", m.ExpirationDate.String(), formats); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this Api license details x o based on context it is used
func (m *APILicenseDetailsXO) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *APILicenseDetailsXO) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *APILicenseDetailsXO) UnmarshalBinary(b []byte) error {
	var res APILicenseDetailsXO
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
