// 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/strfmt"
	"github.com/go-openapi/swag"
)

// URL A URL represents a parsed URL (technically, a URI reference).
//
// The general form represented is:
//
// [scheme:][//[userinfo@]host][/]path[?query][#fragment]
//
// URLs that do not start with a slash after the scheme are interpreted as:
//
// scheme:opaque[?query][#fragment]
//
// The Host field contains the host and port subcomponents of the URL.
// When the port is present, it is separated from the host with a colon.
// When the host is an IPv6 address, it must be enclosed in square brackets:
// "[fe80::1]:80". The [net.JoinHostPort] function combines a host and port
// into a string suitable for the Host field, adding square brackets to
// the host when necessary.
//
// Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.
// A consequence is that it is impossible to tell which slashes in the Path were
// slashes in the raw URL and which were %2f. This distinction is rarely important,
// but when it is, the code should use the [URL.EscapedPath] method, which preserves
// the original encoding of Path.
//
// The RawPath field is an optional field which is only set when the default
// encoding of Path is different from the escaped path. See the EscapedPath method
// for more details.
//
// URL's String method uses the EscapedPath method to obtain the path.
//
// swagger:model URL
type URL struct {

	// force query
	ForceQuery bool `json:"ForceQuery,omitempty"`

	// fragment
	Fragment string `json:"Fragment,omitempty"`

	// host
	Host string `json:"Host,omitempty"`

	// omit host
	OmitHost bool `json:"OmitHost,omitempty"`

	// opaque
	Opaque string `json:"Opaque,omitempty"`

	// path
	Path string `json:"Path,omitempty"`

	// raw fragment
	RawFragment string `json:"RawFragment,omitempty"`

	// raw path
	RawPath string `json:"RawPath,omitempty"`

	// raw query
	RawQuery string `json:"RawQuery,omitempty"`

	// scheme
	Scheme string `json:"Scheme,omitempty"`

	// user
	User Userinfo `json:"User,omitempty"`
}

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

// ContextValidate validates this URL based on context it is used
func (m *URL) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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