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

// Card Card represents a rich preview card that is generated using OpenGraph tags from a URL.
//
// swagger:model Card
type Card struct {

	// The author of the original resource.
	// Example: weewee@buzzfeed.com
	AuthorName string `json:"author_name,omitempty"`

	// A link to the author of the original resource.
	// Example: https://buzzfeed.com/authors/weewee
	AuthorURL string `json:"author_url,omitempty"`

	// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
	Blurhash string `json:"blurhash,omitempty"`

	// Description of preview.
	// Example: Is water wet? We're not sure. In this article, we ask an expert...
	Description string `json:"description,omitempty"`

	// Used for photo embeds, instead of custom html.
	EmbedURL string `json:"embed_url,omitempty"`

	// HTML to be used for generating the preview card.
	HTML string `json:"html,omitempty"`

	// Height of preview, in pixels.
	Height int64 `json:"height,omitempty"`

	// Preview thumbnail.
	// Example: https://example.org/fileserver/preview/thumb.jpg
	Image string `json:"image,omitempty"`

	// The provider of the original resource.
	// Example: Buzzfeed
	ProviderName string `json:"provider_name,omitempty"`

	// A link to the provider of the original resource.
	// Example: https://buzzfeed.com
	ProviderURL string `json:"provider_url,omitempty"`

	// Title of linked resource.
	// Example: Buzzfeed - Is Water Wet?
	Title string `json:"title,omitempty"`

	// The type of the preview card.
	// Example: link
	Type string `json:"type,omitempty"`

	// Location of linked resource.
	// Example: https://buzzfeed.com/some/fuckin/buzzfeed/article
	URL string `json:"url,omitempty"`

	// Width of preview, in pixels.
	Width int64 `json:"width,omitempty"`
}

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

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

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

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