Add optional subscription ID
[ric-plt/xapp-frame.git] / pkg / models / x_app_config.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package models
4
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
7
8 import (
9         "github.com/go-openapi/errors"
10         "github.com/go-openapi/strfmt"
11         "github.com/go-openapi/swag"
12         "github.com/go-openapi/validate"
13 )
14
15 // XAppConfig x app config
16 //
17 // swagger:model XAppConfig
18 type XAppConfig struct {
19
20         // Configuration in JSON format
21         // Required: true
22         Config interface{} `json:"config"`
23
24         // metadata
25         // Required: true
26         Metadata *ConfigMetadata `json:"metadata"`
27 }
28
29 // Validate validates this x app config
30 func (m *XAppConfig) Validate(formats strfmt.Registry) error {
31         var res []error
32
33         if err := m.validateConfig(formats); err != nil {
34                 res = append(res, err)
35         }
36
37         if err := m.validateMetadata(formats); err != nil {
38                 res = append(res, err)
39         }
40
41         if len(res) > 0 {
42                 return errors.CompositeValidationError(res...)
43         }
44         return nil
45 }
46
47 func (m *XAppConfig) validateConfig(formats strfmt.Registry) error {
48
49         if err := validate.Required("config", "body", m.Config); err != nil {
50                 return err
51         }
52
53         return nil
54 }
55
56 func (m *XAppConfig) validateMetadata(formats strfmt.Registry) error {
57
58         if err := validate.Required("metadata", "body", m.Metadata); err != nil {
59                 return err
60         }
61
62         if m.Metadata != nil {
63                 if err := m.Metadata.Validate(formats); err != nil {
64                         if ve, ok := err.(*errors.Validation); ok {
65                                 return ve.ValidateName("metadata")
66                         }
67                         return err
68                 }
69         }
70
71         return nil
72 }
73
74 // MarshalBinary interface implementation
75 func (m *XAppConfig) MarshalBinary() ([]byte, error) {
76         if m == nil {
77                 return nil, nil
78         }
79         return swag.WriteJSON(m)
80 }
81
82 // UnmarshalBinary interface implementation
83 func (m *XAppConfig) UnmarshalBinary(b []byte) error {
84         var res XAppConfig
85         if err := swag.ReadJSON(b, &res); err != nil {
86                 return err
87         }
88         *m = res
89         return nil
90 }