// Code generated by protoc-gen-microweb. DO NOT EDIT.
// source: v0.proto

package v0

import (
	"bytes"
	"encoding/json"

	"github.com/golang/protobuf/jsonpb"
)

// AccountJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Account. This struct is safe to replace or modify but
// should not be done so concurrently.
var AccountJSONMarshaler = new(jsonpb.Marshaler)

// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Account) MarshalJSON() ([]byte, error) {
	if m == nil {
		return json.Marshal(nil)
	}

	buf := &bytes.Buffer{}

	if err := AccountJSONMarshaler.Marshal(buf, m); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

var _ json.Marshaler = (*Account)(nil)

// AccountJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Account. This struct is safe to replace or modify but
// should not be done so concurrently.
var AccountJSONUnmarshaler = new(jsonpb.Unmarshaler)

// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Account) UnmarshalJSON(b []byte) error {
	return AccountJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}

var _ json.Unmarshaler = (*Account)(nil)

// IdentitiesJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Identities. This struct is safe to replace or modify but
// should not be done so concurrently.
var IdentitiesJSONMarshaler = new(jsonpb.Marshaler)

// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Identities) MarshalJSON() ([]byte, error) {
	if m == nil {
		return json.Marshal(nil)
	}

	buf := &bytes.Buffer{}

	if err := IdentitiesJSONMarshaler.Marshal(buf, m); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

var _ json.Marshaler = (*Identities)(nil)

// IdentitiesJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Identities. This struct is safe to replace or modify but
// should not be done so concurrently.
var IdentitiesJSONUnmarshaler = new(jsonpb.Unmarshaler)

// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Identities) UnmarshalJSON(b []byte) error {
	return IdentitiesJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}

var _ json.Unmarshaler = (*Identities)(nil)

// PasswordProfileJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of PasswordProfile. This struct is safe to replace or modify but
// should not be done so concurrently.
var PasswordProfileJSONMarshaler = new(jsonpb.Marshaler)

// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *PasswordProfile) MarshalJSON() ([]byte, error) {
	if m == nil {
		return json.Marshal(nil)
	}

	buf := &bytes.Buffer{}

	if err := PasswordProfileJSONMarshaler.Marshal(buf, m); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

var _ json.Marshaler = (*PasswordProfile)(nil)

// PasswordProfileJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of PasswordProfile. This struct is safe to replace or modify but
// should not be done so concurrently.
var PasswordProfileJSONUnmarshaler = new(jsonpb.Unmarshaler)

// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *PasswordProfile) UnmarshalJSON(b []byte) error {
	return PasswordProfileJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}

var _ json.Unmarshaler = (*PasswordProfile)(nil)

// GroupJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Group. This struct is safe to replace or modify but
// should not be done so concurrently.
var GroupJSONMarshaler = new(jsonpb.Marshaler)

// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Group) MarshalJSON() ([]byte, error) {
	if m == nil {
		return json.Marshal(nil)
	}

	buf := &bytes.Buffer{}

	if err := GroupJSONMarshaler.Marshal(buf, m); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

var _ json.Marshaler = (*Group)(nil)

// GroupJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Group. This struct is safe to replace or modify but
// should not be done so concurrently.
var GroupJSONUnmarshaler = new(jsonpb.Unmarshaler)

// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Group) UnmarshalJSON(b []byte) error {
	return GroupJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}

var _ json.Unmarshaler = (*Group)(nil)

// OnPremisesProvisioningErrorJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of OnPremisesProvisioningError. This struct is safe to replace or modify but
// should not be done so concurrently.
var OnPremisesProvisioningErrorJSONMarshaler = new(jsonpb.Marshaler)

// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *OnPremisesProvisioningError) MarshalJSON() ([]byte, error) {
	if m == nil {
		return json.Marshal(nil)
	}

	buf := &bytes.Buffer{}

	if err := OnPremisesProvisioningErrorJSONMarshaler.Marshal(buf, m); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

var _ json.Marshaler = (*OnPremisesProvisioningError)(nil)

// OnPremisesProvisioningErrorJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of OnPremisesProvisioningError. This struct is safe to replace or modify but
// should not be done so concurrently.
var OnPremisesProvisioningErrorJSONUnmarshaler = new(jsonpb.Unmarshaler)

// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *OnPremisesProvisioningError) UnmarshalJSON(b []byte) error {
	return OnPremisesProvisioningErrorJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}

var _ json.Unmarshaler = (*OnPremisesProvisioningError)(nil)
