// 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"
)

// SecretURL SecretURL is a URL that must not be revealed on marshaling.
//
// swagger:model SecretURL
type SecretURL struct {
	URL
}

// UnmarshalJSON unmarshals this object from a JSON structure
func (m *SecretURL) UnmarshalJSON(raw []byte) error {
	// AO0
	var aO0 URL
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.URL = aO0

	return nil
}

// MarshalJSON marshals this object to a JSON structure
func (m SecretURL) MarshalJSON() ([]byte, error) {
	_parts := make([][]byte, 0, 1)

	aO0, err := swag.WriteJSON(m.URL)
	if err != nil {
		return nil, err
	}
	_parts = append(_parts, aO0)
	return swag.ConcatJSON(_parts...), nil
}

// Validate validates this secret URL
func (m *SecretURL) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validate this secret URL based on the context it is used
func (m *SecretURL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	// validation for a type composition with URL
	if err := m.URL.ContextValidate(ctx, formats); err != nil {
		res = append(res, err)
	}

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