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

// CloudConnectionGRETunnel cloud connection g r e tunnel
//
// swagger:model CloudConnectionGRETunnel
type CloudConnectionGRETunnel struct {

	// gre destination IP address
	// Required: true
	DestIPAddress *string `json:"destIPAddress"`

	// gre auto-assigned source IP address
	// Required: true
	SourceIPAddress *string `json:"sourceIPAddress"`
}

// Validate validates this cloud connection g r e tunnel
func (m *CloudConnectionGRETunnel) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *CloudConnectionGRETunnel) validateDestIPAddress(formats strfmt.Registry) error {

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

	return nil
}

func (m *CloudConnectionGRETunnel) validateSourceIPAddress(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this cloud connection g r e tunnel based on context it is used
func (m *CloudConnectionGRETunnel) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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