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

// Token Token represents an OAuth token used for authenticating with the GoToSocial API and performing actions.
//
// swagger:model Token
type Token struct {

	// Access token used for authorization.
	AccessToken string `json:"access_token,omitempty"`

	// When the OAuth token was generated (UNIX timestamp seconds).
	// Example: 1627644520
	CreatedAt int64 `json:"created_at,omitempty"`

	// OAuth scopes granted by this token, space-separated.
	// Example: read write admin
	Scope string `json:"scope,omitempty"`

	// OAuth token type. Will always be 'Bearer'.
	// Example: bearer
	TokenType string `json:"token_type,omitempty"`
}

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

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

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

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