1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
9 "github.com/go-openapi/errors"
10 "github.com/go-openapi/strfmt"
11 "github.com/go-openapi/swag"
12 "github.com/go-openapi/validate"
15 // SubscriptionDetail subscription detail
17 // swagger:model SubscriptionDetail
18 type SubscriptionDetail struct {
20 // action to be setup list
22 ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
26 EventTriggers EventTriggerDefinition `json:"EventTriggers"`
28 // xapp event instance Id
32 XappEventInstanceID *int64 `json:"XappEventInstanceId"`
35 // Validate validates this subscription detail
36 func (m *SubscriptionDetail) Validate(formats strfmt.Registry) error {
39 if err := m.validateActionToBeSetupList(formats); err != nil {
40 res = append(res, err)
43 if err := m.validateEventTriggers(formats); err != nil {
44 res = append(res, err)
47 if err := m.validateXappEventInstanceID(formats); err != nil {
48 res = append(res, err)
52 return errors.CompositeValidationError(res...)
57 func (m *SubscriptionDetail) validateActionToBeSetupList(formats strfmt.Registry) error {
59 if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
63 if err := m.ActionToBeSetupList.Validate(formats); err != nil {
64 if ve, ok := err.(*errors.Validation); ok {
65 return ve.ValidateName("ActionToBeSetupList")
73 func (m *SubscriptionDetail) validateEventTriggers(formats strfmt.Registry) error {
75 if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
79 if err := m.EventTriggers.Validate(formats); err != nil {
80 if ve, ok := err.(*errors.Validation); ok {
81 return ve.ValidateName("EventTriggers")
89 func (m *SubscriptionDetail) validateXappEventInstanceID(formats strfmt.Registry) error {
91 if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
95 if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
99 if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
106 // MarshalBinary interface implementation
107 func (m *SubscriptionDetail) MarshalBinary() ([]byte, error) {
111 return swag.WriteJSON(m)
114 // UnmarshalBinary interface implementation
115 func (m *SubscriptionDetail) UnmarshalBinary(b []byte) error {
116 var res SubscriptionDetail
117 if err := swag.ReadJSON(b, &res); err != nil {