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

package ops

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

// UserUpdateUserRoleBindingsReq user update user role bindings req
//
// swagger:model user.UpdateUserRoleBindingsReq
type UserUpdateUserRoleBindingsReq struct {

	// email
	// Required: true
	Email *string `json:"email"`

	// role ids
	// Required: true
	RoleIds []int64 `json:"role_ids"`
}

// Validate validates this user update user role bindings req
func (m *UserUpdateUserRoleBindingsReq) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *UserUpdateUserRoleBindingsReq) validateEmail(formats strfmt.Registry) error {

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

	return nil
}

func (m *UserUpdateUserRoleBindingsReq) validateRoleIds(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this user update user role bindings req based on context it is used
func (m *UserUpdateUserRoleBindingsReq) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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