// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

/*
 * (title)
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * API version: 0.0.0
 */

package openapi




// MqttDisconnectedEventProperties - Represents the properties of an MQTT disconnection event.
type MqttDisconnectedEventProperties struct {

	// Indicates whether the disconnection is initiated by the client.
	InitiatedByClient bool `json:"initiatedByClient"`

	// The DISCONNECT packet properties to end the last physical connection. It may be sent by the client or server.
	DisconnectPacket MqttDisconnectPacketProperties `json:"disconnectPacket,omitempty"`
}

// AssertMqttDisconnectedEventPropertiesRequired checks if the required fields are not zero-ed
func AssertMqttDisconnectedEventPropertiesRequired(obj MqttDisconnectedEventProperties) error {
	elements := map[string]interface{}{
		"initiatedByClient": obj.InitiatedByClient,
	}
	for name, el := range elements {
		if isZero := IsZeroValue(el); isZero {
			return &RequiredError{Field: name}
		}
	}

	if err := AssertMqttDisconnectPacketPropertiesRequired(obj.DisconnectPacket); err != nil {
		return err
	}
	return nil
}

// AssertMqttDisconnectedEventPropertiesConstraints checks if the values respects the defined constraints
func AssertMqttDisconnectedEventPropertiesConstraints(obj MqttDisconnectedEventProperties) error {
	if err := AssertMqttDisconnectPacketPropertiesConstraints(obj.DisconnectPacket); err != nil {
		return err
	}
	return nil
}
