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

package model

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

// DataflowObjectStoreS3 This message does not have DWR prefix, because it is shared with Dumpling service.
//
// swagger:model dataflowObjectStoreS3
type DataflowObjectStoreS3 struct {

	// access key
	// Required: true
	AccessKey *string `json:"access_key"`

	// secret key
	// Required: true
	SecretKey *string `json:"secret_key"`

	// Must be prefixed with s3://
	// Required: true
	URI *string `json:"uri"`
}

// Validate validates this dataflow object store s3
func (m *DataflowObjectStoreS3) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

func (m *DataflowObjectStoreS3) validateAccessKey(formats strfmt.Registry) error {

	if err := validate.Required("access_key", "body", m.AccessKey); err != nil {
		return err
	}

	return nil
}

func (m *DataflowObjectStoreS3) validateSecretKey(formats strfmt.Registry) error {

	if err := validate.Required("secret_key", "body", m.SecretKey); err != nil {
		return err
	}

	return nil
}

func (m *DataflowObjectStoreS3) validateURI(formats strfmt.Registry) error {

	if err := validate.Required("uri", "body", m.URI); err != nil {
		return err
	}

	return nil
}

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

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

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